1#![doc = "MAVLink uAvionix dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#![allow(clippy::match_single_binding)]
6#[cfg(feature = "arbitrary")]
7use arbitrary::Arbitrary;
8#[allow(unused_imports)]
9use bitflags::{bitflags, Flags};
10#[allow(unused_imports)]
11use mavlink_core::{
12 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
13};
14#[allow(unused_imports)]
15use num_derive::{FromPrimitive, ToPrimitive};
16#[allow(unused_imports)]
17use num_traits::{FromPrimitive, ToPrimitive};
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "Terminate flight immediately. Flight termination immediately and irreversibly terminates the current flight, returning the vehicle to ground. The vehicle will ignore RC or other input until it has been power-cycled. Termination may trigger safety measures, including: disabling motors and deployment of parachute on multicopters, and setting flight surfaces to initiate a landing pattern on fixed-wing). On multicopters without a parachute it may trigger a crash landing. Support for this command can be tested using the protocol bit: MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION. Support for this command can also be tested by sending the command with param1=0 (<0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746}
1747impl MavCmd {
1748 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1749}
1750impl Default for MavCmd {
1751 fn default() -> Self {
1752 Self::DEFAULT
1753 }
1754}
1755#[cfg_attr(feature = "ts", derive(TS))]
1756#[cfg_attr(feature = "ts", ts(export))]
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Possible actions an aircraft can take to avoid a collision."]
1763pub enum MavCollisionAction {
1764 #[doc = "Ignore any potential collisions"]
1765 MAV_COLLISION_ACTION_NONE = 0,
1766 #[doc = "Report potential collision"]
1767 MAV_COLLISION_ACTION_REPORT = 1,
1768 #[doc = "Ascend or Descend to avoid threat"]
1769 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1770 #[doc = "Move horizontally to avoid threat"]
1771 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1772 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1773 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1774 #[doc = "Aircraft to fly directly back to its launch point"]
1775 MAV_COLLISION_ACTION_RTL = 5,
1776 #[doc = "Aircraft to stop in place"]
1777 MAV_COLLISION_ACTION_HOVER = 6,
1778}
1779impl MavCollisionAction {
1780 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1781}
1782impl Default for MavCollisionAction {
1783 fn default() -> Self {
1784 Self::DEFAULT
1785 }
1786}
1787#[cfg_attr(feature = "ts", derive(TS))]
1788#[cfg_attr(feature = "ts", ts(export))]
1789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1791#[cfg_attr(feature = "serde", serde(tag = "type"))]
1792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1793#[repr(u32)]
1794#[doc = "Source of information about this collision."]
1795pub enum MavCollisionSrc {
1796 #[doc = "ID field references ADSB_VEHICLE packets"]
1797 MAV_COLLISION_SRC_ADSB = 0,
1798 #[doc = "ID field references MAVLink SRC ID"]
1799 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1800}
1801impl MavCollisionSrc {
1802 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1803}
1804impl Default for MavCollisionSrc {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Aircraft-rated danger from this threat."]
1817pub enum MavCollisionThreatLevel {
1818 #[doc = "Not a threat"]
1819 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1820 #[doc = "Craft is mildly concerned about this threat"]
1821 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1822 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1823 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1824}
1825impl MavCollisionThreatLevel {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1827}
1828impl Default for MavCollisionThreatLevel {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[cfg_attr(feature = "ts", derive(TS))]
1834#[cfg_attr(feature = "ts", ts(export))]
1835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1837#[cfg_attr(feature = "serde", serde(tag = "type"))]
1838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1839#[repr(u32)]
1840#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1841pub enum MavComponent {
1842 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1843 MAV_COMP_ID_ALL = 0,
1844 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1845 MAV_COMP_ID_AUTOPILOT1 = 1,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER1 = 25,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER2 = 26,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER3 = 27,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER4 = 28,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER5 = 29,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER6 = 30,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER7 = 31,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER8 = 32,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER9 = 33,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER10 = 34,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER11 = 35,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER12 = 36,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER13 = 37,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER14 = 38,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER15 = 39,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER16 = 40,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER17 = 41,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER18 = 42,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER19 = 43,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER20 = 44,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER21 = 45,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER22 = 46,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER23 = 47,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER24 = 48,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER25 = 49,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER26 = 50,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER27 = 51,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER28 = 52,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER29 = 53,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER30 = 54,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER31 = 55,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER32 = 56,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER33 = 57,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER34 = 58,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER35 = 59,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER36 = 60,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER37 = 61,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER38 = 62,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER39 = 63,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER40 = 64,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER41 = 65,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER42 = 66,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER43 = 67,
1932 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1933 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER45 = 69,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER46 = 70,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER47 = 71,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER48 = 72,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER49 = 73,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER50 = 74,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER51 = 75,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER52 = 76,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER53 = 77,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER54 = 78,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER55 = 79,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER56 = 80,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER57 = 81,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER58 = 82,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER59 = 83,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER60 = 84,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER61 = 85,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER62 = 86,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER63 = 87,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER64 = 88,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER65 = 89,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER66 = 90,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER67 = 91,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER68 = 92,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER69 = 93,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER70 = 94,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER71 = 95,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER72 = 96,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER73 = 97,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER74 = 98,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER75 = 99,
1996 #[doc = "Camera #1."]
1997 MAV_COMP_ID_CAMERA = 100,
1998 #[doc = "Camera #2."]
1999 MAV_COMP_ID_CAMERA2 = 101,
2000 #[doc = "Camera #3."]
2001 MAV_COMP_ID_CAMERA3 = 102,
2002 #[doc = "Camera #4."]
2003 MAV_COMP_ID_CAMERA4 = 103,
2004 #[doc = "Camera #5."]
2005 MAV_COMP_ID_CAMERA5 = 104,
2006 #[doc = "Camera #6."]
2007 MAV_COMP_ID_CAMERA6 = 105,
2008 #[doc = "Servo #1."]
2009 MAV_COMP_ID_SERVO1 = 140,
2010 #[doc = "Servo #2."]
2011 MAV_COMP_ID_SERVO2 = 141,
2012 #[doc = "Servo #3."]
2013 MAV_COMP_ID_SERVO3 = 142,
2014 #[doc = "Servo #4."]
2015 MAV_COMP_ID_SERVO4 = 143,
2016 #[doc = "Servo #5."]
2017 MAV_COMP_ID_SERVO5 = 144,
2018 #[doc = "Servo #6."]
2019 MAV_COMP_ID_SERVO6 = 145,
2020 #[doc = "Servo #7."]
2021 MAV_COMP_ID_SERVO7 = 146,
2022 #[doc = "Servo #8."]
2023 MAV_COMP_ID_SERVO8 = 147,
2024 #[doc = "Servo #9."]
2025 MAV_COMP_ID_SERVO9 = 148,
2026 #[doc = "Servo #10."]
2027 MAV_COMP_ID_SERVO10 = 149,
2028 #[doc = "Servo #11."]
2029 MAV_COMP_ID_SERVO11 = 150,
2030 #[doc = "Servo #12."]
2031 MAV_COMP_ID_SERVO12 = 151,
2032 #[doc = "Servo #13."]
2033 MAV_COMP_ID_SERVO13 = 152,
2034 #[doc = "Servo #14."]
2035 MAV_COMP_ID_SERVO14 = 153,
2036 #[doc = "Gimbal #1."]
2037 MAV_COMP_ID_GIMBAL = 154,
2038 #[doc = "Logging component."]
2039 MAV_COMP_ID_LOG = 155,
2040 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2041 MAV_COMP_ID_ADSB = 156,
2042 #[doc = "On Screen Display (OSD) devices for video links."]
2043 MAV_COMP_ID_OSD = 157,
2044 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2045 MAV_COMP_ID_PERIPHERAL = 158,
2046 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2047 #[doc = "Gimbal ID for QX1."]
2048 MAV_COMP_ID_QX1_GIMBAL = 159,
2049 #[doc = "FLARM collision alert component."]
2050 MAV_COMP_ID_FLARM = 160,
2051 #[doc = "Parachute component."]
2052 MAV_COMP_ID_PARACHUTE = 161,
2053 #[doc = "Winch component."]
2054 MAV_COMP_ID_WINCH = 169,
2055 #[doc = "Gimbal #2."]
2056 MAV_COMP_ID_GIMBAL2 = 171,
2057 #[doc = "Gimbal #3."]
2058 MAV_COMP_ID_GIMBAL3 = 172,
2059 #[doc = "Gimbal #4"]
2060 MAV_COMP_ID_GIMBAL4 = 173,
2061 #[doc = "Gimbal #5."]
2062 MAV_COMP_ID_GIMBAL5 = 174,
2063 #[doc = "Gimbal #6."]
2064 MAV_COMP_ID_GIMBAL6 = 175,
2065 #[doc = "Battery #1."]
2066 MAV_COMP_ID_BATTERY = 180,
2067 #[doc = "Battery #2."]
2068 MAV_COMP_ID_BATTERY2 = 181,
2069 #[doc = "CAN over MAVLink client."]
2070 MAV_COMP_ID_MAVCAN = 189,
2071 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2072 MAV_COMP_ID_MISSIONPLANNER = 190,
2073 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2074 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2081 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2082 MAV_COMP_ID_PATHPLANNER = 195,
2083 #[doc = "Component that plans a collision free path between two points."]
2084 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2085 #[doc = "Component that provides position estimates using VIO techniques."]
2086 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2087 #[doc = "Component that manages pairing of vehicle and GCS."]
2088 MAV_COMP_ID_PAIRING_MANAGER = 198,
2089 #[doc = "Inertial Measurement Unit (IMU) #1."]
2090 MAV_COMP_ID_IMU = 200,
2091 #[doc = "Inertial Measurement Unit (IMU) #2."]
2092 MAV_COMP_ID_IMU_2 = 201,
2093 #[doc = "Inertial Measurement Unit (IMU) #3."]
2094 MAV_COMP_ID_IMU_3 = 202,
2095 #[doc = "GPS #1."]
2096 MAV_COMP_ID_GPS = 220,
2097 #[doc = "GPS #2."]
2098 MAV_COMP_ID_GPS2 = 221,
2099 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2100 MAV_COMP_ID_ODID_TXRX_1 = 236,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_2 = 237,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_3 = 238,
2105 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2106 MAV_COMP_ID_UDP_BRIDGE = 240,
2107 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2108 MAV_COMP_ID_UART_BRIDGE = 241,
2109 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2110 MAV_COMP_ID_TUNNEL_NODE = 242,
2111 #[doc = "Illuminator"]
2112 MAV_COMP_ID_ILLUMINATOR = 243,
2113 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2114 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2115 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2116}
2117impl MavComponent {
2118 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2119}
2120impl Default for MavComponent {
2121 fn default() -> Self {
2122 Self::DEFAULT
2123 }
2124}
2125#[cfg_attr(feature = "ts", derive(TS))]
2126#[cfg_attr(feature = "ts", ts(export))]
2127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2129#[cfg_attr(feature = "serde", serde(tag = "type"))]
2130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2131#[repr(u32)]
2132#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2133#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2134pub enum MavDataStream {
2135 #[doc = "Enable all data streams"]
2136 MAV_DATA_STREAM_ALL = 0,
2137 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2138 MAV_DATA_STREAM_RAW_SENSORS = 1,
2139 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2140 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2141 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2142 MAV_DATA_STREAM_RC_CHANNELS = 3,
2143 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2144 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2145 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2146 MAV_DATA_STREAM_POSITION = 6,
2147 #[doc = "Dependent on the autopilot"]
2148 MAV_DATA_STREAM_EXTRA1 = 10,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA2 = 11,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA3 = 12,
2153}
2154impl MavDataStream {
2155 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2156}
2157impl Default for MavDataStream {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162#[cfg_attr(feature = "ts", derive(TS))]
2163#[cfg_attr(feature = "ts", ts(export))]
2164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166#[cfg_attr(feature = "serde", serde(tag = "type"))]
2167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2168#[repr(u32)]
2169#[doc = "Enumeration of distance sensor types"]
2170pub enum MavDistanceSensor {
2171 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2172 MAV_DISTANCE_SENSOR_LASER = 0,
2173 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2174 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2175 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2176 MAV_DISTANCE_SENSOR_INFRARED = 2,
2177 #[doc = "Radar type, e.g. uLanding units"]
2178 MAV_DISTANCE_SENSOR_RADAR = 3,
2179 #[doc = "Broken or unknown type, e.g. analog units"]
2180 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2181}
2182impl MavDistanceSensor {
2183 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2184}
2185impl Default for MavDistanceSensor {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[cfg_attr(feature = "ts", derive(TS))]
2191#[cfg_attr(feature = "ts", ts(export))]
2192#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2194#[cfg_attr(feature = "serde", serde(tag = "type"))]
2195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2196#[repr(u32)]
2197#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2198pub enum MavDoRepositionFlags {
2199 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2200 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2201}
2202impl MavDoRepositionFlags {
2203 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2204}
2205impl Default for MavDoRepositionFlags {
2206 fn default() -> Self {
2207 Self::DEFAULT
2208 }
2209}
2210#[cfg_attr(feature = "ts", derive(TS))]
2211#[cfg_attr(feature = "ts", ts(export))]
2212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2214#[cfg_attr(feature = "serde", serde(tag = "type"))]
2215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2216#[repr(u32)]
2217#[doc = "Enumeration of estimator types"]
2218pub enum MavEstimatorType {
2219 #[doc = "Unknown type of the estimator."]
2220 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2221 #[doc = "This is a naive estimator without any real covariance feedback."]
2222 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2223 #[doc = "Computer vision based estimate. Might be up to scale."]
2224 MAV_ESTIMATOR_TYPE_VISION = 2,
2225 #[doc = "Visual-inertial estimate."]
2226 MAV_ESTIMATOR_TYPE_VIO = 3,
2227 #[doc = "Plain GPS estimate."]
2228 MAV_ESTIMATOR_TYPE_GPS = 4,
2229 #[doc = "Estimator integrating GPS and inertial sensing."]
2230 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2231 #[doc = "Estimate from external motion capturing system."]
2232 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2233 #[doc = "Estimator based on lidar sensor input."]
2234 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2235 #[doc = "Estimator on autopilot."]
2236 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2237}
2238impl MavEstimatorType {
2239 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2240}
2241impl Default for MavEstimatorType {
2242 fn default() -> Self {
2243 Self::DEFAULT
2244 }
2245}
2246#[cfg_attr(feature = "ts", derive(TS))]
2247#[cfg_attr(feature = "ts", ts(export))]
2248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2250#[cfg_attr(feature = "serde", serde(tag = "type"))]
2251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2252#[repr(u32)]
2253#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2254pub enum MavEventCurrentSequenceFlags {
2255 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2256 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2257}
2258impl MavEventCurrentSequenceFlags {
2259 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2260}
2261impl Default for MavEventCurrentSequenceFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266#[cfg_attr(feature = "ts", derive(TS))]
2267#[cfg_attr(feature = "ts", ts(export))]
2268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2270#[cfg_attr(feature = "serde", serde(tag = "type"))]
2271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2272#[repr(u32)]
2273#[doc = "Reason for an event error response."]
2274pub enum MavEventErrorReason {
2275 #[doc = "The requested event is not available (anymore)."]
2276 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2277}
2278impl MavEventErrorReason {
2279 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2280}
2281impl Default for MavEventErrorReason {
2282 fn default() -> Self {
2283 Self::DEFAULT
2284 }
2285}
2286#[cfg_attr(feature = "ts", derive(TS))]
2287#[cfg_attr(feature = "ts", ts(export))]
2288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2290#[cfg_attr(feature = "serde", serde(tag = "type"))]
2291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2292#[repr(u32)]
2293#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2294pub enum MavFrame {
2295 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2296 MAV_FRAME_GLOBAL = 0,
2297 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2298 MAV_FRAME_LOCAL_NED = 1,
2299 #[doc = "NOT a coordinate frame, indicates a mission command."]
2300 MAV_FRAME_MISSION = 2,
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2302 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2303 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_ENU = 4,
2305 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2306 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2307 MAV_FRAME_GLOBAL_INT = 5,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2310 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2311 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2312 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2313 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2314 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2315 MAV_FRAME_BODY_NED = 8,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2318 MAV_FRAME_BODY_OFFSET_NED = 9,
2319 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2320 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2321 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2322 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2324 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2325 MAV_FRAME_BODY_FRD = 12,
2326 #[deprecated = " (Deprecated since 2019-04)"]
2327 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2328 MAV_FRAME_RESERVED_13 = 13,
2329 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2331 MAV_FRAME_RESERVED_14 = 14,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2334 MAV_FRAME_RESERVED_15 = 15,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_16 = 16,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_17 = 17,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_18 = 18,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_19 = 19,
2347 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2348 MAV_FRAME_LOCAL_FRD = 20,
2349 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FLU = 21,
2351}
2352impl MavFrame {
2353 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2354}
2355impl Default for MavFrame {
2356 fn default() -> Self {
2357 Self::DEFAULT
2358 }
2359}
2360#[cfg_attr(feature = "ts", derive(TS))]
2361#[cfg_attr(feature = "ts", ts(export))]
2362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2364#[cfg_attr(feature = "serde", serde(tag = "type"))]
2365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2366#[repr(u32)]
2367#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2368pub enum MavFtpErr {
2369 #[doc = "None: No error"]
2370 MAV_FTP_ERR_NONE = 0,
2371 #[doc = "Fail: Unknown failure"]
2372 MAV_FTP_ERR_FAIL = 1,
2373 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2374 MAV_FTP_ERR_FAILERRNO = 2,
2375 #[doc = "InvalidDataSize: Payload size is invalid"]
2376 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2377 #[doc = "InvalidSession: Session is not currently open"]
2378 MAV_FTP_ERR_INVALIDSESSION = 4,
2379 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2380 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2381 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2382 MAV_FTP_ERR_EOF = 6,
2383 #[doc = "UnknownCommand: Unknown command / opcode"]
2384 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2385 #[doc = "FileExists: File/directory already exists"]
2386 MAV_FTP_ERR_FILEEXISTS = 8,
2387 #[doc = "FileProtected: File/directory is write protected"]
2388 MAV_FTP_ERR_FILEPROTECTED = 9,
2389 #[doc = "FileNotFound: File/directory not found"]
2390 MAV_FTP_ERR_FILENOTFOUND = 10,
2391}
2392impl MavFtpErr {
2393 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2394}
2395impl Default for MavFtpErr {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[cfg_attr(feature = "ts", derive(TS))]
2401#[cfg_attr(feature = "ts", ts(export))]
2402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2404#[cfg_attr(feature = "serde", serde(tag = "type"))]
2405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2406#[repr(u32)]
2407#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2408pub enum MavFtpOpcode {
2409 #[doc = "None. Ignored, always ACKed"]
2410 MAV_FTP_OPCODE_NONE = 0,
2411 #[doc = "TerminateSession: Terminates open Read session"]
2412 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2413 #[doc = "ResetSessions: Terminates all open read sessions"]
2414 MAV_FTP_OPCODE_RESETSESSION = 2,
2415 #[doc = "ListDirectory. List files and directories in path from offset"]
2416 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2417 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2418 MAV_FTP_OPCODE_OPENFILERO = 4,
2419 #[doc = "ReadFile: Reads size bytes from offset in session"]
2420 MAV_FTP_OPCODE_READFILE = 5,
2421 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2422 MAV_FTP_OPCODE_CREATEFILE = 6,
2423 #[doc = "WriteFile: Writes size bytes to offset in session"]
2424 MAV_FTP_OPCODE_WRITEFILE = 7,
2425 #[doc = "RemoveFile: Remove file at path"]
2426 MAV_FTP_OPCODE_REMOVEFILE = 8,
2427 #[doc = "CreateDirectory: Creates directory at path"]
2428 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2429 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2430 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2431 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2432 MAV_FTP_OPCODE_OPENFILEWO = 11,
2433 #[doc = "TruncateFile: Truncate file at path to offset length"]
2434 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2435 #[doc = "Rename: Rename path1 to path2"]
2436 MAV_FTP_OPCODE_RENAME = 13,
2437 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2438 MAV_FTP_OPCODE_CALCFILECRC = 14,
2439 #[doc = "BurstReadFile: Burst download session file"]
2440 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2441 #[doc = "ACK: ACK response"]
2442 MAV_FTP_OPCODE_ACK = 128,
2443 #[doc = "NAK: NAK response"]
2444 MAV_FTP_OPCODE_NAK = 129,
2445}
2446impl MavFtpOpcode {
2447 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2448}
2449impl Default for MavFtpOpcode {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[cfg_attr(feature = "ts", derive(TS))]
2488#[cfg_attr(feature = "ts", ts(export))]
2489#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2491#[cfg_attr(feature = "serde", serde(tag = "type"))]
2492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2493#[repr(u32)]
2494#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2495pub enum MavGoto {
2496 #[doc = "Hold at the current position."]
2497 MAV_GOTO_DO_HOLD = 0,
2498 #[doc = "Continue with the next item in mission execution."]
2499 MAV_GOTO_DO_CONTINUE = 1,
2500 #[doc = "Hold at the current position of the system"]
2501 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2502 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2503 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2504}
2505impl MavGoto {
2506 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2507}
2508impl Default for MavGoto {
2509 fn default() -> Self {
2510 Self::DEFAULT
2511 }
2512}
2513#[cfg_attr(feature = "ts", derive(TS))]
2514#[cfg_attr(feature = "ts", ts(export))]
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "Enumeration of landed detector states"]
2521pub enum MavLandedState {
2522 #[doc = "MAV landed state is unknown"]
2523 MAV_LANDED_STATE_UNDEFINED = 0,
2524 #[doc = "MAV is landed (on ground)"]
2525 MAV_LANDED_STATE_ON_GROUND = 1,
2526 #[doc = "MAV is in air"]
2527 MAV_LANDED_STATE_IN_AIR = 2,
2528 #[doc = "MAV currently taking off"]
2529 MAV_LANDED_STATE_TAKEOFF = 3,
2530 #[doc = "MAV currently landing"]
2531 MAV_LANDED_STATE_LANDING = 4,
2532}
2533impl MavLandedState {
2534 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2535}
2536impl Default for MavLandedState {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2549pub enum MavMissionResult {
2550 #[doc = "mission accepted OK"]
2551 MAV_MISSION_ACCEPTED = 0,
2552 #[doc = "Generic error / not accepting mission commands at all right now."]
2553 MAV_MISSION_ERROR = 1,
2554 #[doc = "Coordinate frame is not supported."]
2555 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2556 #[doc = "Command is not supported."]
2557 MAV_MISSION_UNSUPPORTED = 3,
2558 #[doc = "Mission items exceed storage space."]
2559 MAV_MISSION_NO_SPACE = 4,
2560 #[doc = "One of the parameters has an invalid value."]
2561 MAV_MISSION_INVALID = 5,
2562 #[doc = "param1 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM1 = 6,
2564 #[doc = "param2 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM2 = 7,
2566 #[doc = "param3 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM3 = 8,
2568 #[doc = "param4 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM4 = 9,
2570 #[doc = "x / param5 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM5_X = 10,
2572 #[doc = "y / param6 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM6_Y = 11,
2574 #[doc = "z / param7 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM7 = 12,
2576 #[doc = "Mission item received out of sequence"]
2577 MAV_MISSION_INVALID_SEQUENCE = 13,
2578 #[doc = "Not accepting any mission commands from this communication partner."]
2579 MAV_MISSION_DENIED = 14,
2580 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2581 MAV_MISSION_OPERATION_CANCELLED = 15,
2582}
2583impl MavMissionResult {
2584 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2585}
2586impl Default for MavMissionResult {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591#[cfg_attr(feature = "ts", derive(TS))]
2592#[cfg_attr(feature = "ts", ts(export))]
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[doc = "Type of mission items being requested/sent in mission protocol."]
2599pub enum MavMissionType {
2600 #[doc = "Items are mission commands for main mission."]
2601 MAV_MISSION_TYPE_MISSION = 0,
2602 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2603 MAV_MISSION_TYPE_FENCE = 1,
2604 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2605 MAV_MISSION_TYPE_RALLY = 2,
2606 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2607 MAV_MISSION_TYPE_ALL = 255,
2608}
2609impl MavMissionType {
2610 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2611}
2612impl Default for MavMissionType {
2613 fn default() -> Self {
2614 Self::DEFAULT
2615 }
2616}
2617#[cfg_attr(feature = "ts", derive(TS))]
2618#[cfg_attr(feature = "ts", ts(export))]
2619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2621#[cfg_attr(feature = "serde", serde(tag = "type"))]
2622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2623#[repr(u32)]
2624#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2625pub enum MavMode {
2626 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2627 MAV_MODE_PREFLIGHT = 0,
2628 #[doc = "System is allowed to be active, under assisted RC control."]
2629 MAV_MODE_STABILIZE_DISARMED = 80,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_ARMED = 208,
2632 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2633 MAV_MODE_MANUAL_DISARMED = 64,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_ARMED = 192,
2636 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2637 MAV_MODE_GUIDED_DISARMED = 88,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_ARMED = 216,
2640 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2641 MAV_MODE_AUTO_DISARMED = 92,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_ARMED = 220,
2644 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2645 MAV_MODE_TEST_DISARMED = 66,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_ARMED = 194,
2648}
2649impl MavMode {
2650 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2651}
2652impl Default for MavMode {
2653 fn default() -> Self {
2654 Self::DEFAULT
2655 }
2656}
2657bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2658impl MavModeFlag {
2659 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2660}
2661impl Default for MavModeFlag {
2662 fn default() -> Self {
2663 Self::DEFAULT
2664 }
2665}
2666#[cfg_attr(feature = "ts", derive(TS))]
2667#[cfg_attr(feature = "ts", ts(export))]
2668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2670#[cfg_attr(feature = "serde", serde(tag = "type"))]
2671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2672#[repr(u32)]
2673#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2674pub enum MavModeFlagDecodePosition {
2675 #[doc = "First bit: 10000000"]
2676 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2677 #[doc = "Second bit: 01000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2679 #[doc = "Third bit: 00100000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2681 #[doc = "Fourth bit: 00010000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2683 #[doc = "Fifth bit: 00001000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2685 #[doc = "Sixth bit: 00000100"]
2686 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2687 #[doc = "Seventh bit: 00000010"]
2688 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2689 #[doc = "Eighth bit: 00000001"]
2690 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2691}
2692impl MavModeFlagDecodePosition {
2693 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2694}
2695impl Default for MavModeFlagDecodePosition {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2701impl MavModeProperty {
2702 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2703}
2704impl Default for MavModeProperty {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[cfg_attr(feature = "ts", derive(TS))]
2710#[cfg_attr(feature = "ts", ts(export))]
2711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2713#[cfg_attr(feature = "serde", serde(tag = "type"))]
2714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2715#[repr(u32)]
2716#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2717#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2718pub enum MavMountMode {
2719 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2720 MAV_MOUNT_MODE_RETRACT = 0,
2721 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2722 MAV_MOUNT_MODE_NEUTRAL = 1,
2723 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2724 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2725 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_RC_TARGETING = 3,
2727 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2728 MAV_MOUNT_MODE_GPS_POINT = 4,
2729 #[doc = "Gimbal tracks system with specified system ID"]
2730 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2731 #[doc = "Gimbal tracks home position"]
2732 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2733}
2734impl MavMountMode {
2735 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2736}
2737impl Default for MavMountMode {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[cfg_attr(feature = "ts", derive(TS))]
2743#[cfg_attr(feature = "ts", ts(export))]
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidArmStatus {
2750 #[doc = "Passing arming checks."]
2751 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2752 #[doc = "Generic arming failure, see error string for details."]
2753 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2754}
2755impl MavOdidArmStatus {
2756 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2757}
2758impl Default for MavOdidArmStatus {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidAuthType {
2771 #[doc = "No authentication type is specified."]
2772 MAV_ODID_AUTH_TYPE_NONE = 0,
2773 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2774 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2775 #[doc = "Signature for the Operator ID."]
2776 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2777 #[doc = "Signature for the entire message set."]
2778 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2779 #[doc = "Authentication is provided by Network Remote ID."]
2780 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2781 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2782 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2783}
2784impl MavOdidAuthType {
2785 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2786}
2787impl Default for MavOdidAuthType {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[cfg_attr(feature = "ts", derive(TS))]
2793#[cfg_attr(feature = "ts", ts(export))]
2794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2796#[cfg_attr(feature = "serde", serde(tag = "type"))]
2797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2798#[repr(u32)]
2799pub enum MavOdidCategoryEu {
2800 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2801 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2802 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2803 MAV_ODID_CATEGORY_EU_OPEN = 1,
2804 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2805 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2806 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2807 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2808}
2809impl MavOdidCategoryEu {
2810 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2811}
2812impl Default for MavOdidCategoryEu {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidClassEu {
2825 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2827 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2828 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2830 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2832 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2834 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2836 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2838 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2840 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2841}
2842impl MavOdidClassEu {
2843 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2844}
2845impl Default for MavOdidClassEu {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[cfg_attr(feature = "ts", derive(TS))]
2851#[cfg_attr(feature = "ts", ts(export))]
2852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2854#[cfg_attr(feature = "serde", serde(tag = "type"))]
2855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2856#[repr(u32)]
2857pub enum MavOdidClassificationType {
2858 #[doc = "The classification type for the UA is undeclared."]
2859 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2860 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2861 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2862}
2863impl MavOdidClassificationType {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2865}
2866impl Default for MavOdidClassificationType {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidDescType {
2879 #[doc = "Optional free-form text description of the purpose of the flight."]
2880 MAV_ODID_DESC_TYPE_TEXT = 0,
2881 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2882 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2883 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2885}
2886impl MavOdidDescType {
2887 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2888}
2889impl Default for MavOdidDescType {
2890 fn default() -> Self {
2891 Self::DEFAULT
2892 }
2893}
2894#[cfg_attr(feature = "ts", derive(TS))]
2895#[cfg_attr(feature = "ts", ts(export))]
2896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2898#[cfg_attr(feature = "serde", serde(tag = "type"))]
2899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2900#[repr(u32)]
2901pub enum MavOdidHeightRef {
2902 #[doc = "The height field is relative to the take-off location."]
2903 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2904 #[doc = "The height field is relative to ground."]
2905 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2906}
2907impl MavOdidHeightRef {
2908 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2909}
2910impl Default for MavOdidHeightRef {
2911 fn default() -> Self {
2912 Self::DEFAULT
2913 }
2914}
2915#[cfg_attr(feature = "ts", derive(TS))]
2916#[cfg_attr(feature = "ts", ts(export))]
2917#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2919#[cfg_attr(feature = "serde", serde(tag = "type"))]
2920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2921#[repr(u32)]
2922pub enum MavOdidHorAcc {
2923 #[doc = "The horizontal accuracy is unknown."]
2924 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2925 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2926 MAV_ODID_HOR_ACC_10NM = 1,
2927 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2928 MAV_ODID_HOR_ACC_4NM = 2,
2929 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2930 MAV_ODID_HOR_ACC_2NM = 3,
2931 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2932 MAV_ODID_HOR_ACC_1NM = 4,
2933 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2934 MAV_ODID_HOR_ACC_0_5NM = 5,
2935 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2936 MAV_ODID_HOR_ACC_0_3NM = 6,
2937 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2938 MAV_ODID_HOR_ACC_0_1NM = 7,
2939 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2940 MAV_ODID_HOR_ACC_0_05NM = 8,
2941 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2942 MAV_ODID_HOR_ACC_30_METER = 9,
2943 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2944 MAV_ODID_HOR_ACC_10_METER = 10,
2945 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2946 MAV_ODID_HOR_ACC_3_METER = 11,
2947 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2948 MAV_ODID_HOR_ACC_1_METER = 12,
2949}
2950impl MavOdidHorAcc {
2951 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2952}
2953impl Default for MavOdidHorAcc {
2954 fn default() -> Self {
2955 Self::DEFAULT
2956 }
2957}
2958#[cfg_attr(feature = "ts", derive(TS))]
2959#[cfg_attr(feature = "ts", ts(export))]
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidIdType {
2966 #[doc = "No type defined."]
2967 MAV_ODID_ID_TYPE_NONE = 0,
2968 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2969 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2970 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2971 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2972 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2973 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2974 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2975 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2976}
2977impl MavOdidIdType {
2978 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2979}
2980impl Default for MavOdidIdType {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[cfg_attr(feature = "ts", derive(TS))]
2986#[cfg_attr(feature = "ts", ts(export))]
2987#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2989#[cfg_attr(feature = "serde", serde(tag = "type"))]
2990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2991#[repr(u32)]
2992pub enum MavOdidOperatorIdType {
2993 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2994 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2995}
2996impl MavOdidOperatorIdType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2998}
2999impl Default for MavOdidOperatorIdType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidOperatorLocationType {
3012 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3013 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3014 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3016 #[doc = "The location/altitude of the operator are fixed values."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3018}
3019impl MavOdidOperatorLocationType {
3020 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3021}
3022impl Default for MavOdidOperatorLocationType {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027#[cfg_attr(feature = "ts", derive(TS))]
3028#[cfg_attr(feature = "ts", ts(export))]
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidSpeedAcc {
3035 #[doc = "The speed accuracy is unknown."]
3036 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3037 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3038 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3039 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3040 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3041 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3042 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3043 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3044 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3045}
3046impl MavOdidSpeedAcc {
3047 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3048}
3049impl Default for MavOdidSpeedAcc {
3050 fn default() -> Self {
3051 Self::DEFAULT
3052 }
3053}
3054#[cfg_attr(feature = "ts", derive(TS))]
3055#[cfg_attr(feature = "ts", ts(export))]
3056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3058#[cfg_attr(feature = "serde", serde(tag = "type"))]
3059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3060#[repr(u32)]
3061pub enum MavOdidStatus {
3062 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3063 MAV_ODID_STATUS_UNDECLARED = 0,
3064 #[doc = "The UA is on the ground."]
3065 MAV_ODID_STATUS_GROUND = 1,
3066 #[doc = "The UA is in the air."]
3067 MAV_ODID_STATUS_AIRBORNE = 2,
3068 #[doc = "The UA is having an emergency."]
3069 MAV_ODID_STATUS_EMERGENCY = 3,
3070 #[doc = "The remote ID system is failing or unreliable in some way."]
3071 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3072}
3073impl MavOdidStatus {
3074 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3075}
3076impl Default for MavOdidStatus {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidTimeAcc {
3089 #[doc = "The timestamp accuracy is unknown."]
3090 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3091 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3092 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3094 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3096 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3098 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3100 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3102 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3104 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3106 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3108 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3110 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3112 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3114 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3116 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3118 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3120 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3121}
3122impl MavOdidTimeAcc {
3123 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3124}
3125impl Default for MavOdidTimeAcc {
3126 fn default() -> Self {
3127 Self::DEFAULT
3128 }
3129}
3130#[cfg_attr(feature = "ts", derive(TS))]
3131#[cfg_attr(feature = "ts", ts(export))]
3132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3134#[cfg_attr(feature = "serde", serde(tag = "type"))]
3135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3136#[repr(u32)]
3137pub enum MavOdidUaType {
3138 #[doc = "No UA (Unmanned Aircraft) type defined."]
3139 MAV_ODID_UA_TYPE_NONE = 0,
3140 #[doc = "Aeroplane/Airplane. Fixed wing."]
3141 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3142 #[doc = "Helicopter or multirotor."]
3143 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3144 #[doc = "Gyroplane."]
3145 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3146 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3147 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3148 #[doc = "Ornithopter."]
3149 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3150 #[doc = "Glider."]
3151 MAV_ODID_UA_TYPE_GLIDER = 6,
3152 #[doc = "Kite."]
3153 MAV_ODID_UA_TYPE_KITE = 7,
3154 #[doc = "Free Balloon."]
3155 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3156 #[doc = "Captive Balloon."]
3157 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3158 #[doc = "Airship. E.g. a blimp."]
3159 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3160 #[doc = "Free Fall/Parachute (unpowered)."]
3161 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3162 #[doc = "Rocket."]
3163 MAV_ODID_UA_TYPE_ROCKET = 12,
3164 #[doc = "Tethered powered aircraft."]
3165 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3166 #[doc = "Ground Obstacle."]
3167 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3168 #[doc = "Other type of aircraft not listed earlier."]
3169 MAV_ODID_UA_TYPE_OTHER = 15,
3170}
3171impl MavOdidUaType {
3172 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3173}
3174impl Default for MavOdidUaType {
3175 fn default() -> Self {
3176 Self::DEFAULT
3177 }
3178}
3179#[cfg_attr(feature = "ts", derive(TS))]
3180#[cfg_attr(feature = "ts", ts(export))]
3181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3183#[cfg_attr(feature = "serde", serde(tag = "type"))]
3184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3185#[repr(u32)]
3186pub enum MavOdidVerAcc {
3187 #[doc = "The vertical accuracy is unknown."]
3188 MAV_ODID_VER_ACC_UNKNOWN = 0,
3189 #[doc = "The vertical accuracy is smaller than 150 meter."]
3190 MAV_ODID_VER_ACC_150_METER = 1,
3191 #[doc = "The vertical accuracy is smaller than 45 meter."]
3192 MAV_ODID_VER_ACC_45_METER = 2,
3193 #[doc = "The vertical accuracy is smaller than 25 meter."]
3194 MAV_ODID_VER_ACC_25_METER = 3,
3195 #[doc = "The vertical accuracy is smaller than 10 meter."]
3196 MAV_ODID_VER_ACC_10_METER = 4,
3197 #[doc = "The vertical accuracy is smaller than 3 meter."]
3198 MAV_ODID_VER_ACC_3_METER = 5,
3199 #[doc = "The vertical accuracy is smaller than 1 meter."]
3200 MAV_ODID_VER_ACC_1_METER = 6,
3201}
3202impl MavOdidVerAcc {
3203 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3204}
3205impl Default for MavOdidVerAcc {
3206 fn default() -> Self {
3207 Self::DEFAULT
3208 }
3209}
3210#[cfg_attr(feature = "ts", derive(TS))]
3211#[cfg_attr(feature = "ts", ts(export))]
3212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3214#[cfg_attr(feature = "serde", serde(tag = "type"))]
3215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3216#[repr(u32)]
3217#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3218pub enum MavParamExtType {
3219 #[doc = "8-bit unsigned integer"]
3220 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3221 #[doc = "8-bit signed integer"]
3222 MAV_PARAM_EXT_TYPE_INT8 = 2,
3223 #[doc = "16-bit unsigned integer"]
3224 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3225 #[doc = "16-bit signed integer"]
3226 MAV_PARAM_EXT_TYPE_INT16 = 4,
3227 #[doc = "32-bit unsigned integer"]
3228 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3229 #[doc = "32-bit signed integer"]
3230 MAV_PARAM_EXT_TYPE_INT32 = 6,
3231 #[doc = "64-bit unsigned integer"]
3232 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3233 #[doc = "64-bit signed integer"]
3234 MAV_PARAM_EXT_TYPE_INT64 = 8,
3235 #[doc = "32-bit floating-point"]
3236 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3237 #[doc = "64-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3239 #[doc = "Custom Type"]
3240 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3241}
3242impl MavParamExtType {
3243 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3244}
3245impl Default for MavParamExtType {
3246 fn default() -> Self {
3247 Self::DEFAULT
3248 }
3249}
3250#[cfg_attr(feature = "ts", derive(TS))]
3251#[cfg_attr(feature = "ts", ts(export))]
3252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3254#[cfg_attr(feature = "serde", serde(tag = "type"))]
3255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3256#[repr(u32)]
3257#[doc = "Specifies the datatype of a MAVLink parameter."]
3258pub enum MavParamType {
3259 #[doc = "8-bit unsigned integer"]
3260 MAV_PARAM_TYPE_UINT8 = 1,
3261 #[doc = "8-bit signed integer"]
3262 MAV_PARAM_TYPE_INT8 = 2,
3263 #[doc = "16-bit unsigned integer"]
3264 MAV_PARAM_TYPE_UINT16 = 3,
3265 #[doc = "16-bit signed integer"]
3266 MAV_PARAM_TYPE_INT16 = 4,
3267 #[doc = "32-bit unsigned integer"]
3268 MAV_PARAM_TYPE_UINT32 = 5,
3269 #[doc = "32-bit signed integer"]
3270 MAV_PARAM_TYPE_INT32 = 6,
3271 #[doc = "64-bit unsigned integer"]
3272 MAV_PARAM_TYPE_UINT64 = 7,
3273 #[doc = "64-bit signed integer"]
3274 MAV_PARAM_TYPE_INT64 = 8,
3275 #[doc = "32-bit floating-point"]
3276 MAV_PARAM_TYPE_REAL32 = 9,
3277 #[doc = "64-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL64 = 10,
3279}
3280impl MavParamType {
3281 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3282}
3283impl Default for MavParamType {
3284 fn default() -> Self {
3285 Self::DEFAULT
3286 }
3287}
3288bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3289impl MavPowerStatus {
3290 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3291}
3292impl Default for MavPowerStatus {
3293 fn default() -> Self {
3294 Self::DEFAULT
3295 }
3296}
3297bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3298impl MavProtocolCapability {
3299 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3300}
3301impl Default for MavProtocolCapability {
3302 fn default() -> Self {
3303 Self::DEFAULT
3304 }
3305}
3306#[cfg_attr(feature = "ts", derive(TS))]
3307#[cfg_attr(feature = "ts", ts(export))]
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Result from a MAVLink command (MAV_CMD)"]
3314pub enum MavResult {
3315 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3316 MAV_RESULT_ACCEPTED = 0,
3317 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3318 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3319 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3320 MAV_RESULT_DENIED = 2,
3321 #[doc = "Command is not supported (unknown)."]
3322 MAV_RESULT_UNSUPPORTED = 3,
3323 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3324 MAV_RESULT_FAILED = 4,
3325 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3326 MAV_RESULT_IN_PROGRESS = 5,
3327 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3328 MAV_RESULT_CANCELLED = 6,
3329 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3330 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3331 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3332 MAV_RESULT_COMMAND_INT_ONLY = 8,
3333 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3334 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3335}
3336impl MavResult {
3337 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3338}
3339impl Default for MavResult {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[cfg_attr(feature = "ts", derive(TS))]
3345#[cfg_attr(feature = "ts", ts(export))]
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3352#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3353pub enum MavRoi {
3354 #[doc = "No region of interest."]
3355 MAV_ROI_NONE = 0,
3356 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3357 MAV_ROI_WPNEXT = 1,
3358 #[doc = "Point toward given waypoint."]
3359 MAV_ROI_WPINDEX = 2,
3360 #[doc = "Point toward fixed location."]
3361 MAV_ROI_LOCATION = 3,
3362 #[doc = "Point toward of given id."]
3363 MAV_ROI_TARGET = 4,
3364}
3365impl MavRoi {
3366 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3367}
3368impl Default for MavRoi {
3369 fn default() -> Self {
3370 Self::DEFAULT
3371 }
3372}
3373#[cfg_attr(feature = "ts", derive(TS))]
3374#[cfg_attr(feature = "ts", ts(export))]
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Enumeration of sensor orientation, according to its rotations"]
3381pub enum MavSensorOrientation {
3382 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_NONE = 0,
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3385 MAV_SENSOR_ROTATION_YAW_45 = 1,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3387 MAV_SENSOR_ROTATION_YAW_90 = 2,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3389 MAV_SENSOR_ROTATION_YAW_135 = 3,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3391 MAV_SENSOR_ROTATION_YAW_180 = 4,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3393 MAV_SENSOR_ROTATION_YAW_225 = 5,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3395 MAV_SENSOR_ROTATION_YAW_270 = 6,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3397 MAV_SENSOR_ROTATION_YAW_315 = 7,
3398 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3399 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3401 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3406 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3407 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3408 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3409 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3414 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3415 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3417 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3422 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3423 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3425 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3430 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3431 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3432 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3434 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3435 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3438 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3439 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3440 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3442 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3444 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3446 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3448 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3450 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3452 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3454 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3455 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3456 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3457 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3458 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3459 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3460 #[doc = "Pitch: 315"]
3461 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3462 #[doc = "Roll: 90, Pitch: 315"]
3463 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3464 #[doc = "Custom orientation"]
3465 MAV_SENSOR_ROTATION_CUSTOM = 100,
3466}
3467impl MavSensorOrientation {
3468 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3469}
3470impl Default for MavSensorOrientation {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[cfg_attr(feature = "ts", derive(TS))]
3476#[cfg_attr(feature = "ts", ts(export))]
3477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3479#[cfg_attr(feature = "serde", serde(tag = "type"))]
3480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3481#[repr(u32)]
3482#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3483pub enum MavSeverity {
3484 #[doc = "System is unusable. This is a \"panic\" condition."]
3485 MAV_SEVERITY_EMERGENCY = 0,
3486 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3487 MAV_SEVERITY_ALERT = 1,
3488 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3489 MAV_SEVERITY_CRITICAL = 2,
3490 #[doc = "Indicates an error in secondary/redundant systems."]
3491 MAV_SEVERITY_ERROR = 3,
3492 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3493 MAV_SEVERITY_WARNING = 4,
3494 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3495 MAV_SEVERITY_NOTICE = 5,
3496 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3497 MAV_SEVERITY_INFO = 6,
3498 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3499 MAV_SEVERITY_DEBUG = 7,
3500}
3501impl MavSeverity {
3502 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3503}
3504impl Default for MavSeverity {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3517pub enum MavStandardMode {
3518 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3519 MAV_STANDARD_MODE_NON_STANDARD = 0,
3520 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3521 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3522 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_ORBIT = 2,
3524 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_CRUISE = 3,
3526 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3528 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3529 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3530 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3531 MAV_STANDARD_MODE_MISSION = 6,
3532 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3533 MAV_STANDARD_MODE_LAND = 7,
3534 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_TAKEOFF = 8,
3536}
3537impl MavStandardMode {
3538 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3539}
3540impl Default for MavStandardMode {
3541 fn default() -> Self {
3542 Self::DEFAULT
3543 }
3544}
3545#[cfg_attr(feature = "ts", derive(TS))]
3546#[cfg_attr(feature = "ts", ts(export))]
3547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3549#[cfg_attr(feature = "serde", serde(tag = "type"))]
3550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3551#[repr(u32)]
3552pub enum MavState {
3553 #[doc = "Uninitialized system, state is unknown."]
3554 MAV_STATE_UNINIT = 0,
3555 #[doc = "System is booting up."]
3556 MAV_STATE_BOOT = 1,
3557 #[doc = "System is calibrating and not flight-ready."]
3558 MAV_STATE_CALIBRATING = 2,
3559 #[doc = "System is grounded and on standby. It can be launched any time."]
3560 MAV_STATE_STANDBY = 3,
3561 #[doc = "System is active and might be already airborne. Motors are engaged."]
3562 MAV_STATE_ACTIVE = 4,
3563 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3564 MAV_STATE_CRITICAL = 5,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3566 MAV_STATE_EMERGENCY = 6,
3567 #[doc = "System just initialized its power-down sequence, will shut down now."]
3568 MAV_STATE_POWEROFF = 7,
3569 #[doc = "System is terminating itself (failsafe or commanded)."]
3570 MAV_STATE_FLIGHT_TERMINATION = 8,
3571}
3572impl MavState {
3573 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3574}
3575impl Default for MavState {
3576 fn default() -> Self {
3577 Self::DEFAULT
3578 }
3579}
3580bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3581impl MavSysStatusSensor {
3582 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3583}
3584impl Default for MavSysStatusSensor {
3585 fn default() -> Self {
3586 Self::DEFAULT
3587 }
3588}
3589bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3590impl MavSysStatusSensorExtended {
3591 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3592}
3593impl Default for MavSysStatusSensorExtended {
3594 fn default() -> Self {
3595 Self::DEFAULT
3596 }
3597}
3598#[cfg_attr(feature = "ts", derive(TS))]
3599#[cfg_attr(feature = "ts", ts(export))]
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605pub enum MavTunnelPayloadType {
3606 #[doc = "Encoding of payload unknown."]
3607 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3608 #[doc = "Registered for STorM32 gimbal controller."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3628 #[doc = "Registered for ModalAI remote OSD protocol."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3630 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3632 #[doc = "Registered for ModalAI vendor use."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3634}
3635impl MavTunnelPayloadType {
3636 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3637}
3638impl Default for MavTunnelPayloadType {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643#[cfg_attr(feature = "ts", derive(TS))]
3644#[cfg_attr(feature = "ts", ts(export))]
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3651pub enum MavType {
3652 #[doc = "Generic micro air vehicle"]
3653 MAV_TYPE_GENERIC = 0,
3654 #[doc = "Fixed wing aircraft."]
3655 MAV_TYPE_FIXED_WING = 1,
3656 #[doc = "Quadrotor"]
3657 MAV_TYPE_QUADROTOR = 2,
3658 #[doc = "Coaxial helicopter"]
3659 MAV_TYPE_COAXIAL = 3,
3660 #[doc = "Normal helicopter with tail rotor."]
3661 MAV_TYPE_HELICOPTER = 4,
3662 #[doc = "Ground installation"]
3663 MAV_TYPE_ANTENNA_TRACKER = 5,
3664 #[doc = "Operator control unit / ground control station"]
3665 MAV_TYPE_GCS = 6,
3666 #[doc = "Airship, controlled"]
3667 MAV_TYPE_AIRSHIP = 7,
3668 #[doc = "Free balloon, uncontrolled"]
3669 MAV_TYPE_FREE_BALLOON = 8,
3670 #[doc = "Rocket"]
3671 MAV_TYPE_ROCKET = 9,
3672 #[doc = "Ground rover"]
3673 MAV_TYPE_GROUND_ROVER = 10,
3674 #[doc = "Surface vessel, boat, ship"]
3675 MAV_TYPE_SURFACE_BOAT = 11,
3676 #[doc = "Submarine"]
3677 MAV_TYPE_SUBMARINE = 12,
3678 #[doc = "Hexarotor"]
3679 MAV_TYPE_HEXAROTOR = 13,
3680 #[doc = "Octorotor"]
3681 MAV_TYPE_OCTOROTOR = 14,
3682 #[doc = "Tricopter"]
3683 MAV_TYPE_TRICOPTER = 15,
3684 #[doc = "Flapping wing"]
3685 MAV_TYPE_FLAPPING_WING = 16,
3686 #[doc = "Kite"]
3687 MAV_TYPE_KITE = 17,
3688 #[doc = "Onboard companion controller"]
3689 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3690 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3691 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3692 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3694 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3695 MAV_TYPE_VTOL_TILTROTOR = 21,
3696 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3697 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3698 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3699 MAV_TYPE_VTOL_TAILSITTER = 23,
3700 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3701 MAV_TYPE_VTOL_TILTWING = 24,
3702 #[doc = "VTOL reserved 5"]
3703 MAV_TYPE_VTOL_RESERVED5 = 25,
3704 #[doc = "Gimbal"]
3705 MAV_TYPE_GIMBAL = 26,
3706 #[doc = "ADSB system"]
3707 MAV_TYPE_ADSB = 27,
3708 #[doc = "Steerable, nonrigid airfoil"]
3709 MAV_TYPE_PARAFOIL = 28,
3710 #[doc = "Dodecarotor"]
3711 MAV_TYPE_DODECAROTOR = 29,
3712 #[doc = "Camera"]
3713 MAV_TYPE_CAMERA = 30,
3714 #[doc = "Charging station"]
3715 MAV_TYPE_CHARGING_STATION = 31,
3716 #[doc = "FLARM collision avoidance system"]
3717 MAV_TYPE_FLARM = 32,
3718 #[doc = "Servo"]
3719 MAV_TYPE_SERVO = 33,
3720 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3721 MAV_TYPE_ODID = 34,
3722 #[doc = "Decarotor"]
3723 MAV_TYPE_DECAROTOR = 35,
3724 #[doc = "Battery"]
3725 MAV_TYPE_BATTERY = 36,
3726 #[doc = "Parachute"]
3727 MAV_TYPE_PARACHUTE = 37,
3728 #[doc = "Log"]
3729 MAV_TYPE_LOG = 38,
3730 #[doc = "OSD"]
3731 MAV_TYPE_OSD = 39,
3732 #[doc = "IMU"]
3733 MAV_TYPE_IMU = 40,
3734 #[doc = "GPS"]
3735 MAV_TYPE_GPS = 41,
3736 #[doc = "Winch"]
3737 MAV_TYPE_WINCH = 42,
3738 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3739 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3740 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3741 MAV_TYPE_ILLUMINATOR = 44,
3742 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3743 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3744}
3745impl MavType {
3746 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3747}
3748impl Default for MavType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "Enumeration of VTOL states"]
3761pub enum MavVtolState {
3762 #[doc = "MAV is not configured as VTOL"]
3763 MAV_VTOL_STATE_UNDEFINED = 0,
3764 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3765 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3766 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3767 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3768 #[doc = "VTOL is in multicopter state"]
3769 MAV_VTOL_STATE_MC = 3,
3770 #[doc = "VTOL is in fixed-wing state"]
3771 MAV_VTOL_STATE_FW = 4,
3772}
3773impl MavVtolState {
3774 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3775}
3776impl Default for MavVtolState {
3777 fn default() -> Self {
3778 Self::DEFAULT
3779 }
3780}
3781bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3782impl MavWinchStatusFlag {
3783 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3784}
3785impl Default for MavWinchStatusFlag {
3786 fn default() -> Self {
3787 Self::DEFAULT
3788 }
3789}
3790#[cfg_attr(feature = "ts", derive(TS))]
3791#[cfg_attr(feature = "ts", ts(export))]
3792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3794#[cfg_attr(feature = "serde", serde(tag = "type"))]
3795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3796#[repr(u32)]
3797pub enum MavlinkDataStreamType {
3798 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3799 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3800 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3801 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3802 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3803 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3804}
3805impl MavlinkDataStreamType {
3806 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3807}
3808impl Default for MavlinkDataStreamType {
3809 fn default() -> Self {
3810 Self::DEFAULT
3811 }
3812}
3813#[cfg_attr(feature = "ts", derive(TS))]
3814#[cfg_attr(feature = "ts", ts(export))]
3815#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3817#[cfg_attr(feature = "serde", serde(tag = "type"))]
3818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3819#[repr(u32)]
3820#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3821pub enum MissionState {
3822 #[doc = "The mission status reporting is not supported."]
3823 MISSION_STATE_UNKNOWN = 0,
3824 #[doc = "No mission on the vehicle."]
3825 MISSION_STATE_NO_MISSION = 1,
3826 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3827 MISSION_STATE_NOT_STARTED = 2,
3828 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3829 MISSION_STATE_ACTIVE = 3,
3830 #[doc = "Mission is paused when in auto mode."]
3831 MISSION_STATE_PAUSED = 4,
3832 #[doc = "Mission has executed all mission items."]
3833 MISSION_STATE_COMPLETE = 5,
3834}
3835impl MissionState {
3836 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3837}
3838impl Default for MissionState {
3839 fn default() -> Self {
3840 Self::DEFAULT
3841 }
3842}
3843#[cfg_attr(feature = "ts", derive(TS))]
3844#[cfg_attr(feature = "ts", ts(export))]
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3851pub enum MotorTestOrder {
3852 #[doc = "Default autopilot motor test method."]
3853 MOTOR_TEST_ORDER_DEFAULT = 0,
3854 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3855 MOTOR_TEST_ORDER_SEQUENCE = 1,
3856 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3857 MOTOR_TEST_ORDER_BOARD = 2,
3858}
3859impl MotorTestOrder {
3860 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3861}
3862impl Default for MotorTestOrder {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3875pub enum MotorTestThrottleType {
3876 #[doc = "Throttle as a percentage (0 ~ 100)"]
3877 MOTOR_TEST_THROTTLE_PERCENT = 0,
3878 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3879 MOTOR_TEST_THROTTLE_PWM = 1,
3880 #[doc = "Throttle pass-through from pilot's transmitter."]
3881 MOTOR_TEST_THROTTLE_PILOT = 2,
3882 #[doc = "Per-motor compass calibration test."]
3883 MOTOR_TEST_COMPASS_CAL = 3,
3884}
3885impl MotorTestThrottleType {
3886 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3887}
3888impl Default for MotorTestThrottleType {
3889 fn default() -> Self {
3890 Self::DEFAULT
3891 }
3892}
3893#[cfg_attr(feature = "ts", derive(TS))]
3894#[cfg_attr(feature = "ts", ts(export))]
3895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3897#[cfg_attr(feature = "serde", serde(tag = "type"))]
3898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3899#[repr(u32)]
3900pub enum NavVtolLandOptions {
3901 #[doc = "Default autopilot landing behaviour."]
3902 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3903 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3904 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3905 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3906 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3907}
3908impl NavVtolLandOptions {
3909 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3910}
3911impl Default for NavVtolLandOptions {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[cfg_attr(feature = "ts", derive(TS))]
3917#[cfg_attr(feature = "ts", ts(export))]
3918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3920#[cfg_attr(feature = "serde", serde(tag = "type"))]
3921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3922#[repr(u32)]
3923#[doc = "Yaw behaviour during orbit flight."]
3924pub enum OrbitYawBehaviour {
3925 #[doc = "Vehicle front points to the center (default)."]
3926 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3927 #[doc = "Vehicle front holds heading when message received."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3929 #[doc = "Yaw uncontrolled."]
3930 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3931 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3932 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3933 #[doc = "Yaw controlled by RC input."]
3934 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3935 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3936 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3937}
3938impl OrbitYawBehaviour {
3939 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3940}
3941impl Default for OrbitYawBehaviour {
3942 fn default() -> Self {
3943 Self::DEFAULT
3944 }
3945}
3946#[cfg_attr(feature = "ts", derive(TS))]
3947#[cfg_attr(feature = "ts", ts(export))]
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3954pub enum ParachuteAction {
3955 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3956 PARACHUTE_DISABLE = 0,
3957 #[doc = "Enable auto-release of parachute."]
3958 PARACHUTE_ENABLE = 1,
3959 #[doc = "Release parachute and kill motors."]
3960 PARACHUTE_RELEASE = 2,
3961}
3962impl ParachuteAction {
3963 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3964}
3965impl Default for ParachuteAction {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Result from PARAM_EXT_SET message."]
3978pub enum ParamAck {
3979 #[doc = "Parameter value ACCEPTED and SET"]
3980 PARAM_ACK_ACCEPTED = 0,
3981 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3982 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3983 #[doc = "Parameter failed to set"]
3984 PARAM_ACK_FAILED = 2,
3985 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3986 PARAM_ACK_IN_PROGRESS = 3,
3987}
3988impl ParamAck {
3989 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3990}
3991impl Default for ParamAck {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3997impl PositionTargetTypemask {
3998 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3999}
4000impl Default for PositionTargetTypemask {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[cfg_attr(feature = "ts", derive(TS))]
4006#[cfg_attr(feature = "ts", ts(export))]
4007#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4009#[cfg_attr(feature = "serde", serde(tag = "type"))]
4010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4011#[repr(u32)]
4012#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4013pub enum PrecisionLandMode {
4014 #[doc = "Normal (non-precision) landing."]
4015 PRECISION_LAND_MODE_DISABLED = 0,
4016 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4017 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4018 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4019 PRECISION_LAND_MODE_REQUIRED = 2,
4020}
4021impl PrecisionLandMode {
4022 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4023}
4024impl Default for PrecisionLandMode {
4025 fn default() -> Self {
4026 Self::DEFAULT
4027 }
4028}
4029#[cfg_attr(feature = "ts", derive(TS))]
4030#[cfg_attr(feature = "ts", ts(export))]
4031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4033#[cfg_attr(feature = "serde", serde(tag = "type"))]
4034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4035#[repr(u32)]
4036#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4037pub enum PreflightStorageMissionAction {
4038 #[doc = "Read current mission data from persistent storage"]
4039 MISSION_READ_PERSISTENT = 0,
4040 #[doc = "Write current mission data to persistent storage"]
4041 MISSION_WRITE_PERSISTENT = 1,
4042 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4043 MISSION_RESET_DEFAULT = 2,
4044}
4045impl PreflightStorageMissionAction {
4046 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4047}
4048impl Default for PreflightStorageMissionAction {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[cfg_attr(feature = "ts", derive(TS))]
4054#[cfg_attr(feature = "ts", ts(export))]
4055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4057#[cfg_attr(feature = "serde", serde(tag = "type"))]
4058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4059#[repr(u32)]
4060#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4061pub enum PreflightStorageParameterAction {
4062 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4063 PARAM_READ_PERSISTENT = 0,
4064 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4065 PARAM_WRITE_PERSISTENT = 1,
4066 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4067 PARAM_RESET_CONFIG_DEFAULT = 2,
4068 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4069 PARAM_RESET_SENSOR_DEFAULT = 3,
4070 #[doc = "Reset all parameters, including operation counters, to default values"]
4071 PARAM_RESET_ALL_DEFAULT = 4,
4072}
4073impl PreflightStorageParameterAction {
4074 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4075}
4076impl Default for PreflightStorageParameterAction {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[cfg_attr(feature = "ts", derive(TS))]
4082#[cfg_attr(feature = "ts", ts(export))]
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4089pub enum RcSubType {
4090 #[doc = "Spektrum DSM2"]
4091 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4092 #[doc = "Spektrum DSMX"]
4093 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4094 #[doc = "Spektrum DSMX8"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4096}
4097impl RcSubType {
4098 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4099}
4100impl Default for RcSubType {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4113pub enum RcType {
4114 #[doc = "Spektrum"]
4115 RC_TYPE_SPEKTRUM = 0,
4116 #[doc = "CRSF"]
4117 RC_TYPE_CRSF = 1,
4118}
4119impl RcType {
4120 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4121}
4122impl Default for RcType {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[cfg_attr(feature = "ts", derive(TS))]
4128#[cfg_attr(feature = "ts", ts(export))]
4129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4131#[cfg_attr(feature = "serde", serde(tag = "type"))]
4132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4133#[repr(u32)]
4134#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4135pub enum RebootShutdownConditions {
4136 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4137 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4138 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4139 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4140}
4141impl RebootShutdownConditions {
4142 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4143}
4144impl Default for RebootShutdownConditions {
4145 fn default() -> Self {
4146 Self::DEFAULT
4147 }
4148}
4149#[cfg_attr(feature = "ts", derive(TS))]
4150#[cfg_attr(feature = "ts", ts(export))]
4151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4153#[cfg_attr(feature = "serde", serde(tag = "type"))]
4154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4155#[repr(u32)]
4156#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4157pub enum RtkBaselineCoordinateSystem {
4158 #[doc = "Earth-centered, Earth-fixed"]
4159 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4160 #[doc = "RTK basestation centered, north, east, down"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4162}
4163impl RtkBaselineCoordinateSystem {
4164 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4165}
4166impl Default for RtkBaselineCoordinateSystem {
4167 fn default() -> Self {
4168 Self::DEFAULT
4169 }
4170}
4171#[cfg_attr(feature = "ts", derive(TS))]
4172#[cfg_attr(feature = "ts", ts(export))]
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Possible safety switch states."]
4179pub enum SafetySwitchState {
4180 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4181 SAFETY_SWITCH_STATE_SAFE = 0,
4182 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4183 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4184}
4185impl SafetySwitchState {
4186 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4187}
4188impl Default for SafetySwitchState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[cfg_attr(feature = "ts", derive(TS))]
4194#[cfg_attr(feature = "ts", ts(export))]
4195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4197#[cfg_attr(feature = "serde", serde(tag = "type"))]
4198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4199#[repr(u32)]
4200#[doc = "SERIAL_CONTROL device types"]
4201pub enum SerialControlDev {
4202 #[doc = "First telemetry port"]
4203 SERIAL_CONTROL_DEV_TELEM1 = 0,
4204 #[doc = "Second telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM2 = 1,
4206 #[doc = "First GPS port"]
4207 SERIAL_CONTROL_DEV_GPS1 = 2,
4208 #[doc = "Second GPS port"]
4209 SERIAL_CONTROL_DEV_GPS2 = 3,
4210 #[doc = "system shell"]
4211 SERIAL_CONTROL_DEV_SHELL = 10,
4212 #[doc = "SERIAL0"]
4213 SERIAL_CONTROL_SERIAL0 = 100,
4214 #[doc = "SERIAL1"]
4215 SERIAL_CONTROL_SERIAL1 = 101,
4216 #[doc = "SERIAL2"]
4217 SERIAL_CONTROL_SERIAL2 = 102,
4218 #[doc = "SERIAL3"]
4219 SERIAL_CONTROL_SERIAL3 = 103,
4220 #[doc = "SERIAL4"]
4221 SERIAL_CONTROL_SERIAL4 = 104,
4222 #[doc = "SERIAL5"]
4223 SERIAL_CONTROL_SERIAL5 = 105,
4224 #[doc = "SERIAL6"]
4225 SERIAL_CONTROL_SERIAL6 = 106,
4226 #[doc = "SERIAL7"]
4227 SERIAL_CONTROL_SERIAL7 = 107,
4228 #[doc = "SERIAL8"]
4229 SERIAL_CONTROL_SERIAL8 = 108,
4230 #[doc = "SERIAL9"]
4231 SERIAL_CONTROL_SERIAL9 = 109,
4232}
4233impl SerialControlDev {
4234 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4235}
4236impl Default for SerialControlDev {
4237 fn default() -> Self {
4238 Self::DEFAULT
4239 }
4240}
4241bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4242impl SerialControlFlag {
4243 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4244}
4245impl Default for SerialControlFlag {
4246 fn default() -> Self {
4247 Self::DEFAULT
4248 }
4249}
4250#[cfg_attr(feature = "ts", derive(TS))]
4251#[cfg_attr(feature = "ts", ts(export))]
4252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4254#[cfg_attr(feature = "serde", serde(tag = "type"))]
4255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4256#[repr(u32)]
4257#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4258pub enum SetFocusType {
4259 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4260 FOCUS_TYPE_STEP = 0,
4261 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4262 FOCUS_TYPE_CONTINUOUS = 1,
4263 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4264 FOCUS_TYPE_RANGE = 2,
4265 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4266 FOCUS_TYPE_METERS = 3,
4267 #[doc = "Focus automatically."]
4268 FOCUS_TYPE_AUTO = 4,
4269 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4270 FOCUS_TYPE_AUTO_SINGLE = 5,
4271 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4272 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4273}
4274impl SetFocusType {
4275 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4276}
4277impl Default for SetFocusType {
4278 fn default() -> Self {
4279 Self::DEFAULT
4280 }
4281}
4282#[cfg_attr(feature = "ts", derive(TS))]
4283#[cfg_attr(feature = "ts", ts(export))]
4284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4286#[cfg_attr(feature = "serde", serde(tag = "type"))]
4287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4288#[repr(u32)]
4289#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4290pub enum SpeedType {
4291 #[doc = "Airspeed"]
4292 SPEED_TYPE_AIRSPEED = 0,
4293 #[doc = "Groundspeed"]
4294 SPEED_TYPE_GROUNDSPEED = 1,
4295 #[doc = "Climb speed"]
4296 SPEED_TYPE_CLIMB_SPEED = 2,
4297 #[doc = "Descent speed"]
4298 SPEED_TYPE_DESCENT_SPEED = 3,
4299}
4300impl SpeedType {
4301 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4302}
4303impl Default for SpeedType {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[cfg_attr(feature = "ts", derive(TS))]
4309#[cfg_attr(feature = "ts", ts(export))]
4310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4312#[cfg_attr(feature = "serde", serde(tag = "type"))]
4313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4314#[repr(u32)]
4315#[doc = "Flags to indicate the status of camera storage."]
4316pub enum StorageStatus {
4317 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4318 STORAGE_STATUS_EMPTY = 0,
4319 #[doc = "Storage present but unformatted."]
4320 STORAGE_STATUS_UNFORMATTED = 1,
4321 #[doc = "Storage present and ready."]
4322 STORAGE_STATUS_READY = 2,
4323 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4324 STORAGE_STATUS_NOT_SUPPORTED = 3,
4325}
4326impl StorageStatus {
4327 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4328}
4329impl Default for StorageStatus {
4330 fn default() -> Self {
4331 Self::DEFAULT
4332 }
4333}
4334#[cfg_attr(feature = "ts", derive(TS))]
4335#[cfg_attr(feature = "ts", ts(export))]
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Flags to indicate the type of storage."]
4342pub enum StorageType {
4343 #[doc = "Storage type is not known."]
4344 STORAGE_TYPE_UNKNOWN = 0,
4345 #[doc = "Storage type is USB device."]
4346 STORAGE_TYPE_USB_STICK = 1,
4347 #[doc = "Storage type is SD card."]
4348 STORAGE_TYPE_SD = 2,
4349 #[doc = "Storage type is microSD card."]
4350 STORAGE_TYPE_MICROSD = 3,
4351 #[doc = "Storage type is CFast."]
4352 STORAGE_TYPE_CF = 4,
4353 #[doc = "Storage type is CFexpress."]
4354 STORAGE_TYPE_CFE = 5,
4355 #[doc = "Storage type is XQD."]
4356 STORAGE_TYPE_XQD = 6,
4357 #[doc = "Storage type is HD mass storage type."]
4358 STORAGE_TYPE_HD = 7,
4359 #[doc = "Storage type is other, not listed type."]
4360 STORAGE_TYPE_OTHER = 254,
4361}
4362impl StorageType {
4363 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4364}
4365impl Default for StorageType {
4366 fn default() -> Self {
4367 Self::DEFAULT
4368 }
4369}
4370bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4371impl StorageUsageFlag {
4372 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4373}
4374impl Default for StorageUsageFlag {
4375 fn default() -> Self {
4376 Self::DEFAULT
4377 }
4378}
4379#[cfg_attr(feature = "ts", derive(TS))]
4380#[cfg_attr(feature = "ts", ts(export))]
4381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4383#[cfg_attr(feature = "serde", serde(tag = "type"))]
4384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4385#[repr(u32)]
4386#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4387pub enum TuneFormat {
4388 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4389 TUNE_FORMAT_QBASIC1_1 = 1,
4390 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4391 TUNE_FORMAT_MML_MODERN = 2,
4392}
4393impl TuneFormat {
4394 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4395}
4396impl Default for TuneFormat {
4397 fn default() -> Self {
4398 Self::DEFAULT
4399 }
4400}
4401#[cfg_attr(feature = "ts", derive(TS))]
4402#[cfg_attr(feature = "ts", ts(export))]
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Generalized UAVCAN node health"]
4409pub enum UavcanNodeHealth {
4410 #[doc = "The node is functioning properly."]
4411 UAVCAN_NODE_HEALTH_OK = 0,
4412 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4413 UAVCAN_NODE_HEALTH_WARNING = 1,
4414 #[doc = "The node has encountered a major failure."]
4415 UAVCAN_NODE_HEALTH_ERROR = 2,
4416 #[doc = "The node has suffered a fatal malfunction."]
4417 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4418}
4419impl UavcanNodeHealth {
4420 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4421}
4422impl Default for UavcanNodeHealth {
4423 fn default() -> Self {
4424 Self::DEFAULT
4425 }
4426}
4427#[cfg_attr(feature = "ts", derive(TS))]
4428#[cfg_attr(feature = "ts", ts(export))]
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Generalized UAVCAN node mode"]
4435pub enum UavcanNodeMode {
4436 #[doc = "The node is performing its primary functions."]
4437 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4438 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4439 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4440 #[doc = "The node is under maintenance."]
4441 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4442 #[doc = "The node is in the process of updating its software."]
4443 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4444 #[doc = "The node is no longer available online."]
4445 UAVCAN_NODE_MODE_OFFLINE = 7,
4446}
4447impl UavcanNodeMode {
4448 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4449}
4450impl Default for UavcanNodeMode {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455#[cfg_attr(feature = "ts", derive(TS))]
4456#[cfg_attr(feature = "ts", ts(export))]
4457#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4459#[cfg_attr(feature = "serde", serde(tag = "type"))]
4460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4461#[repr(u32)]
4462#[doc = "Emergency status encoding"]
4463pub enum UavionixAdsbEmergencyStatus {
4464 UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0,
4465 UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1,
4466 UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2,
4467 UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3,
4468 UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4,
4469 UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5,
4470 UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6,
4471 UAVIONIX_ADSB_OUT_RESERVED = 7,
4472}
4473impl UavionixAdsbEmergencyStatus {
4474 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_NO_EMERGENCY;
4475}
4476impl Default for UavionixAdsbEmergencyStatus {
4477 fn default() -> Self {
4478 Self::DEFAULT
4479 }
4480}
4481#[cfg_attr(feature = "ts", derive(TS))]
4482#[cfg_attr(feature = "ts", ts(export))]
4483#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4485#[cfg_attr(feature = "serde", serde(tag = "type"))]
4486#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4487#[repr(u32)]
4488#[doc = "Definitions for aircraft size"]
4489pub enum UavionixAdsbOutCfgAircraftSize {
4490 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0,
4491 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1,
4492 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2,
4493 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3,
4494 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4,
4495 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5,
4496 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6,
4497 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7,
4498 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8,
4499 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9,
4500 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10,
4501 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11,
4502 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12,
4503 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13,
4504 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14,
4505 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15,
4506}
4507impl UavionixAdsbOutCfgAircraftSize {
4508 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA;
4509}
4510impl Default for UavionixAdsbOutCfgAircraftSize {
4511 fn default() -> Self {
4512 Self::DEFAULT
4513 }
4514}
4515#[cfg_attr(feature = "ts", derive(TS))]
4516#[cfg_attr(feature = "ts", ts(export))]
4517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4519#[cfg_attr(feature = "serde", serde(tag = "type"))]
4520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4521#[repr(u32)]
4522#[doc = "GPS lataral offset encoding"]
4523pub enum UavionixAdsbOutCfgGpsOffsetLat {
4524 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0,
4525 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1,
4526 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2,
4527 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3,
4528 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4,
4529 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5,
4530 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6,
4531 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7,
4532}
4533impl UavionixAdsbOutCfgGpsOffsetLat {
4534 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA;
4535}
4536impl Default for UavionixAdsbOutCfgGpsOffsetLat {
4537 fn default() -> Self {
4538 Self::DEFAULT
4539 }
4540}
4541#[cfg_attr(feature = "ts", derive(TS))]
4542#[cfg_attr(feature = "ts", ts(export))]
4543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4545#[cfg_attr(feature = "serde", serde(tag = "type"))]
4546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4547#[repr(u32)]
4548#[doc = "GPS longitudinal offset encoding"]
4549pub enum UavionixAdsbOutCfgGpsOffsetLon {
4550 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0,
4551 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1,
4552}
4553impl UavionixAdsbOutCfgGpsOffsetLon {
4554 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA;
4555}
4556impl Default for UavionixAdsbOutCfgGpsOffsetLon {
4557 fn default() -> Self {
4558 Self::DEFAULT
4559 }
4560}
4561bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutControlState : u8 { const UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED = 1 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_ON_GROUND = 4 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_IDENT_BUTTON_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_1090ES_TX_ENABLED = 128 ; } }
4562impl UavionixAdsbOutControlState {
4563 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED;
4564}
4565impl Default for UavionixAdsbOutControlState {
4566 fn default() -> Self {
4567 Self::DEFAULT
4568 }
4569}
4570#[cfg_attr(feature = "ts", derive(TS))]
4571#[cfg_attr(feature = "ts", ts(export))]
4572#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4574#[cfg_attr(feature = "serde", serde(tag = "type"))]
4575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4576#[repr(u32)]
4577#[doc = "Status for ADS-B transponder dynamic input"]
4578pub enum UavionixAdsbOutDynamicGpsFix {
4579 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0,
4580 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1,
4581 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2,
4582 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3,
4583 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4,
4584 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5,
4585}
4586impl UavionixAdsbOutDynamicGpsFix {
4587 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0;
4588}
4589impl Default for UavionixAdsbOutDynamicGpsFix {
4590 fn default() -> Self {
4591 Self::DEFAULT
4592 }
4593}
4594bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutDynamicState : u16 { const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16 ; } }
4595impl UavionixAdsbOutDynamicState {
4596 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE;
4597}
4598impl Default for UavionixAdsbOutDynamicState {
4599 fn default() -> Self {
4600 Self::DEFAULT
4601 }
4602}
4603bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Transceiver RF control flags for ADS-B transponder dynamic reports"] pub struct UavionixAdsbOutRfSelect : u8 { const UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1 ; const UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2 ; } }
4604impl UavionixAdsbOutRfSelect {
4605 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED;
4606}
4607impl Default for UavionixAdsbOutRfSelect {
4608 fn default() -> Self {
4609 Self::DEFAULT
4610 }
4611}
4612bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder fault report"] pub struct UavionixAdsbOutStatusFault : u8 { const UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL = 8 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_NO_POS = 16 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_UNAVAIL = 32 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_TX_SYSTEM_FAIL = 64 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_MAINT_REQ = 128 ; } }
4613impl UavionixAdsbOutStatusFault {
4614 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL;
4615}
4616impl Default for UavionixAdsbOutStatusFault {
4617 fn default() -> Self {
4618 Self::DEFAULT
4619 }
4620}
4621#[cfg_attr(feature = "ts", derive(TS))]
4622#[cfg_attr(feature = "ts", ts(export))]
4623#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4625#[cfg_attr(feature = "serde", serde(tag = "type"))]
4626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4627#[repr(u32)]
4628#[doc = "State flags for ADS-B transponder status report"]
4629pub enum UavionixAdsbOutStatusNicNacp {
4630 UAVIONIX_ADSB_NIC_CR_20_NM = 1,
4631 UAVIONIX_ADSB_NIC_CR_8_NM = 2,
4632 UAVIONIX_ADSB_NIC_CR_4_NM = 3,
4633 UAVIONIX_ADSB_NIC_CR_2_NM = 4,
4634 UAVIONIX_ADSB_NIC_CR_1_NM = 5,
4635 UAVIONIX_ADSB_NIC_CR_0_3_NM = 6,
4636 UAVIONIX_ADSB_NIC_CR_0_2_NM = 7,
4637 UAVIONIX_ADSB_NIC_CR_0_1_NM = 8,
4638 UAVIONIX_ADSB_NIC_CR_75_M = 9,
4639 UAVIONIX_ADSB_NIC_CR_25_M = 10,
4640 UAVIONIX_ADSB_NIC_CR_7_5_M = 11,
4641 UAVIONIX_ADSB_NACP_EPU_10_NM = 16,
4642 UAVIONIX_ADSB_NACP_EPU_4_NM = 32,
4643 UAVIONIX_ADSB_NACP_EPU_2_NM = 48,
4644 UAVIONIX_ADSB_NACP_EPU_1_NM = 64,
4645 UAVIONIX_ADSB_NACP_EPU_0_5_NM = 80,
4646 UAVIONIX_ADSB_NACP_EPU_0_3_NM = 96,
4647 UAVIONIX_ADSB_NACP_EPU_0_1_NM = 112,
4648 UAVIONIX_ADSB_NACP_EPU_0_05_NM = 128,
4649 UAVIONIX_ADSB_NACP_EPU_30_M = 144,
4650 UAVIONIX_ADSB_NACP_EPU_10_M = 160,
4651 UAVIONIX_ADSB_NACP_EPU_3_M = 176,
4652}
4653impl UavionixAdsbOutStatusNicNacp {
4654 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_NIC_CR_20_NM;
4655}
4656impl Default for UavionixAdsbOutStatusNicNacp {
4657 fn default() -> Self {
4658 Self::DEFAULT
4659 }
4660}
4661bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder status report"] pub struct UavionixAdsbOutStatusState : u8 { const UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND = 1 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_INTERROGATED_SINCE_LAST = 2 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_XBIT_ENABLED = 4 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_IDENT_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_1090ES_TX_ENABLED = 128 ; } }
4662impl UavionixAdsbOutStatusState {
4663 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND;
4664}
4665impl Default for UavionixAdsbOutStatusState {
4666 fn default() -> Self {
4667 Self::DEFAULT
4668 }
4669}
4670bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Status flags for ADS-B transponder dynamic output"] pub struct UavionixAdsbRfHealth : u8 { const UAVIONIX_ADSB_RF_HEALTH_OK = 1 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16 ; } }
4671impl UavionixAdsbRfHealth {
4672 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_RF_HEALTH_OK;
4673}
4674impl Default for UavionixAdsbRfHealth {
4675 fn default() -> Self {
4676 Self::DEFAULT
4677 }
4678}
4679bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for X-Bit and reserved fields."] pub struct UavionixAdsbXbit : u8 { const UAVIONIX_ADSB_XBIT_ENABLED = 128 ; } }
4680impl UavionixAdsbXbit {
4681 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_XBIT_ENABLED;
4682}
4683impl Default for UavionixAdsbXbit {
4684 fn default() -> Self {
4685 Self::DEFAULT
4686 }
4687}
4688bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4689impl UtmDataAvailFlags {
4690 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4691}
4692impl Default for UtmDataAvailFlags {
4693 fn default() -> Self {
4694 Self::DEFAULT
4695 }
4696}
4697#[cfg_attr(feature = "ts", derive(TS))]
4698#[cfg_attr(feature = "ts", ts(export))]
4699#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4701#[cfg_attr(feature = "serde", serde(tag = "type"))]
4702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4703#[repr(u32)]
4704#[doc = "Airborne status of UAS."]
4705pub enum UtmFlightState {
4706 #[doc = "The flight state can't be determined."]
4707 UTM_FLIGHT_STATE_UNKNOWN = 1,
4708 #[doc = "UAS on ground."]
4709 UTM_FLIGHT_STATE_GROUND = 2,
4710 #[doc = "UAS airborne."]
4711 UTM_FLIGHT_STATE_AIRBORNE = 3,
4712 #[doc = "UAS is in an emergency flight state."]
4713 UTM_FLIGHT_STATE_EMERGENCY = 16,
4714 #[doc = "UAS has no active controls."]
4715 UTM_FLIGHT_STATE_NOCTRL = 32,
4716}
4717impl UtmFlightState {
4718 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4719}
4720impl Default for UtmFlightState {
4721 fn default() -> Self {
4722 Self::DEFAULT
4723 }
4724}
4725#[cfg_attr(feature = "ts", derive(TS))]
4726#[cfg_attr(feature = "ts", ts(export))]
4727#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4729#[cfg_attr(feature = "serde", serde(tag = "type"))]
4730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4731#[repr(u32)]
4732#[doc = "Video stream encodings"]
4733pub enum VideoStreamEncoding {
4734 #[doc = "Stream encoding is unknown"]
4735 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4736 #[doc = "Stream encoding is H.264"]
4737 VIDEO_STREAM_ENCODING_H264 = 1,
4738 #[doc = "Stream encoding is H.265"]
4739 VIDEO_STREAM_ENCODING_H265 = 2,
4740}
4741impl VideoStreamEncoding {
4742 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4743}
4744impl Default for VideoStreamEncoding {
4745 fn default() -> Self {
4746 Self::DEFAULT
4747 }
4748}
4749bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4750impl VideoStreamStatusFlags {
4751 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4752}
4753impl Default for VideoStreamStatusFlags {
4754 fn default() -> Self {
4755 Self::DEFAULT
4756 }
4757}
4758#[cfg_attr(feature = "ts", derive(TS))]
4759#[cfg_attr(feature = "ts", ts(export))]
4760#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4761#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4762#[cfg_attr(feature = "serde", serde(tag = "type"))]
4763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4764#[repr(u32)]
4765#[doc = "Video stream types"]
4766pub enum VideoStreamType {
4767 #[doc = "Stream is RTSP"]
4768 VIDEO_STREAM_TYPE_RTSP = 0,
4769 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4770 VIDEO_STREAM_TYPE_RTPUDP = 1,
4771 #[doc = "Stream is MPEG on TCP"]
4772 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4773 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4774 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4775}
4776impl VideoStreamType {
4777 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4778}
4779impl Default for VideoStreamType {
4780 fn default() -> Self {
4781 Self::DEFAULT
4782 }
4783}
4784#[cfg_attr(feature = "ts", derive(TS))]
4785#[cfg_attr(feature = "ts", ts(export))]
4786#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4787#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4788#[cfg_attr(feature = "serde", serde(tag = "type"))]
4789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4790#[repr(u32)]
4791#[doc = "Direction of VTOL transition"]
4792pub enum VtolTransitionHeading {
4793 #[doc = "Respect the heading configuration of the vehicle."]
4794 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4795 #[doc = "Use the heading pointing towards the next waypoint."]
4796 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4797 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4798 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4799 #[doc = "Use the specified heading in parameter 4."]
4800 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4801 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4802 VTOL_TRANSITION_HEADING_ANY = 4,
4803}
4804impl VtolTransitionHeading {
4805 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4806}
4807impl Default for VtolTransitionHeading {
4808 fn default() -> Self {
4809 Self::DEFAULT
4810 }
4811}
4812#[cfg_attr(feature = "ts", derive(TS))]
4813#[cfg_attr(feature = "ts", ts(export))]
4814#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4816#[cfg_attr(feature = "serde", serde(tag = "type"))]
4817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4818#[repr(u32)]
4819#[doc = "WiFi Mode."]
4820pub enum WifiConfigApMode {
4821 #[doc = "WiFi mode is undefined."]
4822 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4823 #[doc = "WiFi configured as an access point."]
4824 WIFI_CONFIG_AP_MODE_AP = 1,
4825 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4826 WIFI_CONFIG_AP_MODE_STATION = 2,
4827 #[doc = "WiFi disabled."]
4828 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4829}
4830impl WifiConfigApMode {
4831 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4832}
4833impl Default for WifiConfigApMode {
4834 fn default() -> Self {
4835 Self::DEFAULT
4836 }
4837}
4838#[cfg_attr(feature = "ts", derive(TS))]
4839#[cfg_attr(feature = "ts", ts(export))]
4840#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4842#[cfg_attr(feature = "serde", serde(tag = "type"))]
4843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4844#[repr(u32)]
4845#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4846pub enum WifiConfigApResponse {
4847 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4848 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4849 #[doc = "Changes accepted."]
4850 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4851 #[doc = "Changes rejected."]
4852 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4853 #[doc = "Invalid Mode."]
4854 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4855 #[doc = "Invalid SSID."]
4856 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4857 #[doc = "Invalid Password."]
4858 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4859}
4860impl WifiConfigApResponse {
4861 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4862}
4863impl Default for WifiConfigApResponse {
4864 fn default() -> Self {
4865 Self::DEFAULT
4866 }
4867}
4868#[cfg_attr(feature = "ts", derive(TS))]
4869#[cfg_attr(feature = "ts", ts(export))]
4870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4872#[cfg_attr(feature = "serde", serde(tag = "type"))]
4873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4874#[repr(u32)]
4875#[doc = "Winch actions."]
4876pub enum WinchActions {
4877 #[doc = "Allow motor to freewheel."]
4878 WINCH_RELAXED = 0,
4879 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4880 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4881 #[doc = "Wind or unwind line at specified rate."]
4882 WINCH_RATE_CONTROL = 2,
4883 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4884 WINCH_LOCK = 3,
4885 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4886 WINCH_DELIVER = 4,
4887 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4888 WINCH_HOLD = 5,
4889 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4890 WINCH_RETRACT = 6,
4891 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4892 WINCH_LOAD_LINE = 7,
4893 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4894 WINCH_ABANDON_LINE = 8,
4895 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4896 WINCH_LOAD_PAYLOAD = 9,
4897}
4898impl WinchActions {
4899 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4900}
4901impl Default for WinchActions {
4902 fn default() -> Self {
4903 Self::DEFAULT
4904 }
4905}
4906#[doc = "Set the vehicle attitude and body angular rates."]
4907#[doc = ""]
4908#[doc = "ID: 140"]
4909#[derive(Debug, Clone, PartialEq)]
4910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4912#[cfg_attr(feature = "ts", derive(TS))]
4913#[cfg_attr(feature = "ts", ts(export))]
4914pub struct ACTUATOR_CONTROL_TARGET_DATA {
4915 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4916 pub time_usec: u64,
4917 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4920 pub controls: [f32; 8],
4921 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4922 pub group_mlx: u8,
4923}
4924impl ACTUATOR_CONTROL_TARGET_DATA {
4925 pub const ENCODED_LEN: usize = 41usize;
4926 pub const DEFAULT: Self = Self {
4927 time_usec: 0_u64,
4928 controls: [0.0_f32; 8usize],
4929 group_mlx: 0_u8,
4930 };
4931 #[cfg(feature = "arbitrary")]
4932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4933 use arbitrary::{Arbitrary, Unstructured};
4934 let mut buf = [0u8; 1024];
4935 rng.fill_bytes(&mut buf);
4936 let mut unstructured = Unstructured::new(&buf);
4937 Self::arbitrary(&mut unstructured).unwrap_or_default()
4938 }
4939}
4940impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4941 fn default() -> Self {
4942 Self::DEFAULT.clone()
4943 }
4944}
4945impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4946 type Message = MavMessage;
4947 const ID: u32 = 140u32;
4948 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4949 const EXTRA_CRC: u8 = 181u8;
4950 const ENCODED_LEN: usize = 41usize;
4951 fn deser(
4952 _version: MavlinkVersion,
4953 __input: &[u8],
4954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4955 let avail_len = __input.len();
4956 let mut payload_buf = [0; Self::ENCODED_LEN];
4957 let mut buf = if avail_len < Self::ENCODED_LEN {
4958 payload_buf[0..avail_len].copy_from_slice(__input);
4959 Bytes::new(&payload_buf)
4960 } else {
4961 Bytes::new(__input)
4962 };
4963 let mut __struct = Self::default();
4964 __struct.time_usec = buf.get_u64_le()?;
4965 for v in &mut __struct.controls {
4966 let val = buf.get_f32_le()?;
4967 *v = val;
4968 }
4969 __struct.group_mlx = buf.get_u8()?;
4970 Ok(__struct)
4971 }
4972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4973 let mut __tmp = BytesMut::new(bytes);
4974 #[allow(clippy::absurd_extreme_comparisons)]
4975 #[allow(unused_comparisons)]
4976 if __tmp.remaining() < Self::ENCODED_LEN {
4977 panic!(
4978 "buffer is too small (need {} bytes, but got {})",
4979 Self::ENCODED_LEN,
4980 __tmp.remaining(),
4981 )
4982 }
4983 __tmp.put_u64_le(self.time_usec);
4984 for val in &self.controls {
4985 __tmp.put_f32_le(*val);
4986 }
4987 __tmp.put_u8(self.group_mlx);
4988 if matches!(version, MavlinkVersion::V2) {
4989 let len = __tmp.len();
4990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4991 } else {
4992 __tmp.len()
4993 }
4994 }
4995}
4996#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4997#[doc = ""]
4998#[doc = "ID: 375"]
4999#[derive(Debug, Clone, PartialEq)]
5000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5002#[cfg_attr(feature = "ts", derive(TS))]
5003#[cfg_attr(feature = "ts", ts(export))]
5004pub struct ACTUATOR_OUTPUT_STATUS_DATA {
5005 #[doc = "Timestamp (since system boot)."]
5006 pub time_usec: u64,
5007 #[doc = "Active outputs"]
5008 pub active: u32,
5009 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
5010 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5011 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5012 pub actuator: [f32; 32],
5013}
5014impl ACTUATOR_OUTPUT_STATUS_DATA {
5015 pub const ENCODED_LEN: usize = 140usize;
5016 pub const DEFAULT: Self = Self {
5017 time_usec: 0_u64,
5018 active: 0_u32,
5019 actuator: [0.0_f32; 32usize],
5020 };
5021 #[cfg(feature = "arbitrary")]
5022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5023 use arbitrary::{Arbitrary, Unstructured};
5024 let mut buf = [0u8; 1024];
5025 rng.fill_bytes(&mut buf);
5026 let mut unstructured = Unstructured::new(&buf);
5027 Self::arbitrary(&mut unstructured).unwrap_or_default()
5028 }
5029}
5030impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
5031 fn default() -> Self {
5032 Self::DEFAULT.clone()
5033 }
5034}
5035impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
5036 type Message = MavMessage;
5037 const ID: u32 = 375u32;
5038 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
5039 const EXTRA_CRC: u8 = 251u8;
5040 const ENCODED_LEN: usize = 140usize;
5041 fn deser(
5042 _version: MavlinkVersion,
5043 __input: &[u8],
5044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5045 let avail_len = __input.len();
5046 let mut payload_buf = [0; Self::ENCODED_LEN];
5047 let mut buf = if avail_len < Self::ENCODED_LEN {
5048 payload_buf[0..avail_len].copy_from_slice(__input);
5049 Bytes::new(&payload_buf)
5050 } else {
5051 Bytes::new(__input)
5052 };
5053 let mut __struct = Self::default();
5054 __struct.time_usec = buf.get_u64_le()?;
5055 __struct.active = buf.get_u32_le()?;
5056 for v in &mut __struct.actuator {
5057 let val = buf.get_f32_le()?;
5058 *v = val;
5059 }
5060 Ok(__struct)
5061 }
5062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5063 let mut __tmp = BytesMut::new(bytes);
5064 #[allow(clippy::absurd_extreme_comparisons)]
5065 #[allow(unused_comparisons)]
5066 if __tmp.remaining() < Self::ENCODED_LEN {
5067 panic!(
5068 "buffer is too small (need {} bytes, but got {})",
5069 Self::ENCODED_LEN,
5070 __tmp.remaining(),
5071 )
5072 }
5073 __tmp.put_u64_le(self.time_usec);
5074 __tmp.put_u32_le(self.active);
5075 for val in &self.actuator {
5076 __tmp.put_f32_le(*val);
5077 }
5078 if matches!(version, MavlinkVersion::V2) {
5079 let len = __tmp.len();
5080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5081 } else {
5082 __tmp.len()
5083 }
5084 }
5085}
5086#[doc = "The location and information of an ADSB vehicle."]
5087#[doc = ""]
5088#[doc = "ID: 246"]
5089#[derive(Debug, Clone, PartialEq)]
5090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5092#[cfg_attr(feature = "ts", derive(TS))]
5093#[cfg_attr(feature = "ts", ts(export))]
5094pub struct ADSB_VEHICLE_DATA {
5095 #[doc = "ICAO address"]
5096 pub ICAO_address: u32,
5097 #[doc = "Latitude"]
5098 pub lat: i32,
5099 #[doc = "Longitude"]
5100 pub lon: i32,
5101 #[doc = "Altitude(ASL)"]
5102 pub altitude: i32,
5103 #[doc = "Course over ground"]
5104 pub heading: u16,
5105 #[doc = "The horizontal velocity"]
5106 pub hor_velocity: u16,
5107 #[doc = "The vertical velocity. Positive is up"]
5108 pub ver_velocity: i16,
5109 #[doc = "Bitmap to indicate various statuses including valid data fields"]
5110 pub flags: AdsbFlags,
5111 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
5112 pub squawk: u16,
5113 #[doc = "ADSB altitude type."]
5114 pub altitude_type: AdsbAltitudeType,
5115 #[doc = "The callsign, 8+null"]
5116 #[cfg_attr(feature = "ts", ts(type = "string"))]
5117 pub callsign: CharArray<9>,
5118 #[doc = "ADSB emitter type."]
5119 pub emitter_type: AdsbEmitterType,
5120 #[doc = "Time since last communication in seconds"]
5121 pub tslc: u8,
5122}
5123impl ADSB_VEHICLE_DATA {
5124 pub const ENCODED_LEN: usize = 38usize;
5125 pub const DEFAULT: Self = Self {
5126 ICAO_address: 0_u32,
5127 lat: 0_i32,
5128 lon: 0_i32,
5129 altitude: 0_i32,
5130 heading: 0_u16,
5131 hor_velocity: 0_u16,
5132 ver_velocity: 0_i16,
5133 flags: AdsbFlags::DEFAULT,
5134 squawk: 0_u16,
5135 altitude_type: AdsbAltitudeType::DEFAULT,
5136 callsign: CharArray::new([0_u8; 9usize]),
5137 emitter_type: AdsbEmitterType::DEFAULT,
5138 tslc: 0_u8,
5139 };
5140 #[cfg(feature = "arbitrary")]
5141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5142 use arbitrary::{Arbitrary, Unstructured};
5143 let mut buf = [0u8; 1024];
5144 rng.fill_bytes(&mut buf);
5145 let mut unstructured = Unstructured::new(&buf);
5146 Self::arbitrary(&mut unstructured).unwrap_or_default()
5147 }
5148}
5149impl Default for ADSB_VEHICLE_DATA {
5150 fn default() -> Self {
5151 Self::DEFAULT.clone()
5152 }
5153}
5154impl MessageData for ADSB_VEHICLE_DATA {
5155 type Message = MavMessage;
5156 const ID: u32 = 246u32;
5157 const NAME: &'static str = "ADSB_VEHICLE";
5158 const EXTRA_CRC: u8 = 184u8;
5159 const ENCODED_LEN: usize = 38usize;
5160 fn deser(
5161 _version: MavlinkVersion,
5162 __input: &[u8],
5163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5164 let avail_len = __input.len();
5165 let mut payload_buf = [0; Self::ENCODED_LEN];
5166 let mut buf = if avail_len < Self::ENCODED_LEN {
5167 payload_buf[0..avail_len].copy_from_slice(__input);
5168 Bytes::new(&payload_buf)
5169 } else {
5170 Bytes::new(__input)
5171 };
5172 let mut __struct = Self::default();
5173 __struct.ICAO_address = buf.get_u32_le()?;
5174 __struct.lat = buf.get_i32_le()?;
5175 __struct.lon = buf.get_i32_le()?;
5176 __struct.altitude = buf.get_i32_le()?;
5177 __struct.heading = buf.get_u16_le()?;
5178 __struct.hor_velocity = buf.get_u16_le()?;
5179 __struct.ver_velocity = buf.get_i16_le()?;
5180 let tmp = buf.get_u16_le()?;
5181 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
5182 ::mavlink_core::error::ParserError::InvalidFlag {
5183 flag_type: "AdsbFlags",
5184 value: tmp as u64,
5185 },
5186 )?;
5187 __struct.squawk = buf.get_u16_le()?;
5188 let tmp = buf.get_u8()?;
5189 __struct.altitude_type =
5190 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5191 enum_type: "AdsbAltitudeType",
5192 value: tmp as u64,
5193 })?;
5194 let mut tmp = [0_u8; 9usize];
5195 for v in &mut tmp {
5196 *v = buf.get_u8()?;
5197 }
5198 __struct.callsign = CharArray::new(tmp);
5199 let tmp = buf.get_u8()?;
5200 __struct.emitter_type =
5201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5202 enum_type: "AdsbEmitterType",
5203 value: tmp as u64,
5204 })?;
5205 __struct.tslc = buf.get_u8()?;
5206 Ok(__struct)
5207 }
5208 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5209 let mut __tmp = BytesMut::new(bytes);
5210 #[allow(clippy::absurd_extreme_comparisons)]
5211 #[allow(unused_comparisons)]
5212 if __tmp.remaining() < Self::ENCODED_LEN {
5213 panic!(
5214 "buffer is too small (need {} bytes, but got {})",
5215 Self::ENCODED_LEN,
5216 __tmp.remaining(),
5217 )
5218 }
5219 __tmp.put_u32_le(self.ICAO_address);
5220 __tmp.put_i32_le(self.lat);
5221 __tmp.put_i32_le(self.lon);
5222 __tmp.put_i32_le(self.altitude);
5223 __tmp.put_u16_le(self.heading);
5224 __tmp.put_u16_le(self.hor_velocity);
5225 __tmp.put_i16_le(self.ver_velocity);
5226 __tmp.put_u16_le(self.flags.bits() as u16);
5227 __tmp.put_u16_le(self.squawk);
5228 __tmp.put_u8(self.altitude_type as u8);
5229 for val in &self.callsign {
5230 __tmp.put_u8(*val);
5231 }
5232 __tmp.put_u8(self.emitter_type as u8);
5233 __tmp.put_u8(self.tslc);
5234 if matches!(version, MavlinkVersion::V2) {
5235 let len = __tmp.len();
5236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5237 } else {
5238 __tmp.len()
5239 }
5240 }
5241}
5242#[doc = "The location and information of an AIS vessel."]
5243#[doc = ""]
5244#[doc = "ID: 301"]
5245#[derive(Debug, Clone, PartialEq)]
5246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5248#[cfg_attr(feature = "ts", derive(TS))]
5249#[cfg_attr(feature = "ts", ts(export))]
5250pub struct AIS_VESSEL_DATA {
5251 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5252 pub MMSI: u32,
5253 #[doc = "Latitude"]
5254 pub lat: i32,
5255 #[doc = "Longitude"]
5256 pub lon: i32,
5257 #[doc = "Course over ground"]
5258 pub COG: u16,
5259 #[doc = "True heading"]
5260 pub heading: u16,
5261 #[doc = "Speed over ground"]
5262 pub velocity: u16,
5263 #[doc = "Distance from lat/lon location to bow"]
5264 pub dimension_bow: u16,
5265 #[doc = "Distance from lat/lon location to stern"]
5266 pub dimension_stern: u16,
5267 #[doc = "Time since last communication in seconds"]
5268 pub tslc: u16,
5269 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5270 pub flags: AisFlags,
5271 #[doc = "Turn rate"]
5272 pub turn_rate: i8,
5273 #[doc = "Navigational status"]
5274 pub navigational_status: AisNavStatus,
5275 #[doc = "Type of vessels"]
5276 pub mavtype: AisType,
5277 #[doc = "Distance from lat/lon location to port side"]
5278 pub dimension_port: u8,
5279 #[doc = "Distance from lat/lon location to starboard side"]
5280 pub dimension_starboard: u8,
5281 #[doc = "The vessel callsign"]
5282 #[cfg_attr(feature = "ts", ts(type = "string"))]
5283 pub callsign: CharArray<7>,
5284 #[doc = "The vessel name"]
5285 #[cfg_attr(feature = "ts", ts(type = "string"))]
5286 pub name: CharArray<20>,
5287}
5288impl AIS_VESSEL_DATA {
5289 pub const ENCODED_LEN: usize = 58usize;
5290 pub const DEFAULT: Self = Self {
5291 MMSI: 0_u32,
5292 lat: 0_i32,
5293 lon: 0_i32,
5294 COG: 0_u16,
5295 heading: 0_u16,
5296 velocity: 0_u16,
5297 dimension_bow: 0_u16,
5298 dimension_stern: 0_u16,
5299 tslc: 0_u16,
5300 flags: AisFlags::DEFAULT,
5301 turn_rate: 0_i8,
5302 navigational_status: AisNavStatus::DEFAULT,
5303 mavtype: AisType::DEFAULT,
5304 dimension_port: 0_u8,
5305 dimension_starboard: 0_u8,
5306 callsign: CharArray::new([0_u8; 7usize]),
5307 name: CharArray::new([0_u8; 20usize]),
5308 };
5309 #[cfg(feature = "arbitrary")]
5310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5311 use arbitrary::{Arbitrary, Unstructured};
5312 let mut buf = [0u8; 1024];
5313 rng.fill_bytes(&mut buf);
5314 let mut unstructured = Unstructured::new(&buf);
5315 Self::arbitrary(&mut unstructured).unwrap_or_default()
5316 }
5317}
5318impl Default for AIS_VESSEL_DATA {
5319 fn default() -> Self {
5320 Self::DEFAULT.clone()
5321 }
5322}
5323impl MessageData for AIS_VESSEL_DATA {
5324 type Message = MavMessage;
5325 const ID: u32 = 301u32;
5326 const NAME: &'static str = "AIS_VESSEL";
5327 const EXTRA_CRC: u8 = 243u8;
5328 const ENCODED_LEN: usize = 58usize;
5329 fn deser(
5330 _version: MavlinkVersion,
5331 __input: &[u8],
5332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5333 let avail_len = __input.len();
5334 let mut payload_buf = [0; Self::ENCODED_LEN];
5335 let mut buf = if avail_len < Self::ENCODED_LEN {
5336 payload_buf[0..avail_len].copy_from_slice(__input);
5337 Bytes::new(&payload_buf)
5338 } else {
5339 Bytes::new(__input)
5340 };
5341 let mut __struct = Self::default();
5342 __struct.MMSI = buf.get_u32_le()?;
5343 __struct.lat = buf.get_i32_le()?;
5344 __struct.lon = buf.get_i32_le()?;
5345 __struct.COG = buf.get_u16_le()?;
5346 __struct.heading = buf.get_u16_le()?;
5347 __struct.velocity = buf.get_u16_le()?;
5348 __struct.dimension_bow = buf.get_u16_le()?;
5349 __struct.dimension_stern = buf.get_u16_le()?;
5350 __struct.tslc = buf.get_u16_le()?;
5351 let tmp = buf.get_u16_le()?;
5352 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5353 ::mavlink_core::error::ParserError::InvalidFlag {
5354 flag_type: "AisFlags",
5355 value: tmp as u64,
5356 },
5357 )?;
5358 __struct.turn_rate = buf.get_i8()?;
5359 let tmp = buf.get_u8()?;
5360 __struct.navigational_status =
5361 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5362 enum_type: "AisNavStatus",
5363 value: tmp as u64,
5364 })?;
5365 let tmp = buf.get_u8()?;
5366 __struct.mavtype =
5367 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5368 enum_type: "AisType",
5369 value: tmp as u64,
5370 })?;
5371 __struct.dimension_port = buf.get_u8()?;
5372 __struct.dimension_starboard = buf.get_u8()?;
5373 let mut tmp = [0_u8; 7usize];
5374 for v in &mut tmp {
5375 *v = buf.get_u8()?;
5376 }
5377 __struct.callsign = CharArray::new(tmp);
5378 let mut tmp = [0_u8; 20usize];
5379 for v in &mut tmp {
5380 *v = buf.get_u8()?;
5381 }
5382 __struct.name = CharArray::new(tmp);
5383 Ok(__struct)
5384 }
5385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5386 let mut __tmp = BytesMut::new(bytes);
5387 #[allow(clippy::absurd_extreme_comparisons)]
5388 #[allow(unused_comparisons)]
5389 if __tmp.remaining() < Self::ENCODED_LEN {
5390 panic!(
5391 "buffer is too small (need {} bytes, but got {})",
5392 Self::ENCODED_LEN,
5393 __tmp.remaining(),
5394 )
5395 }
5396 __tmp.put_u32_le(self.MMSI);
5397 __tmp.put_i32_le(self.lat);
5398 __tmp.put_i32_le(self.lon);
5399 __tmp.put_u16_le(self.COG);
5400 __tmp.put_u16_le(self.heading);
5401 __tmp.put_u16_le(self.velocity);
5402 __tmp.put_u16_le(self.dimension_bow);
5403 __tmp.put_u16_le(self.dimension_stern);
5404 __tmp.put_u16_le(self.tslc);
5405 __tmp.put_u16_le(self.flags.bits() as u16);
5406 __tmp.put_i8(self.turn_rate);
5407 __tmp.put_u8(self.navigational_status as u8);
5408 __tmp.put_u8(self.mavtype as u8);
5409 __tmp.put_u8(self.dimension_port);
5410 __tmp.put_u8(self.dimension_starboard);
5411 for val in &self.callsign {
5412 __tmp.put_u8(*val);
5413 }
5414 for val in &self.name {
5415 __tmp.put_u8(*val);
5416 }
5417 if matches!(version, MavlinkVersion::V2) {
5418 let len = __tmp.len();
5419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5420 } else {
5421 __tmp.len()
5422 }
5423 }
5424}
5425#[doc = "The current system altitude."]
5426#[doc = ""]
5427#[doc = "ID: 141"]
5428#[derive(Debug, Clone, PartialEq)]
5429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5431#[cfg_attr(feature = "ts", derive(TS))]
5432#[cfg_attr(feature = "ts", ts(export))]
5433pub struct ALTITUDE_DATA {
5434 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5435 pub time_usec: u64,
5436 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5437 pub altitude_monotonic: f32,
5438 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5439 pub altitude_amsl: f32,
5440 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5441 pub altitude_local: f32,
5442 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5443 pub altitude_relative: f32,
5444 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5445 pub altitude_terrain: f32,
5446 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5447 pub bottom_clearance: f32,
5448}
5449impl ALTITUDE_DATA {
5450 pub const ENCODED_LEN: usize = 32usize;
5451 pub const DEFAULT: Self = Self {
5452 time_usec: 0_u64,
5453 altitude_monotonic: 0.0_f32,
5454 altitude_amsl: 0.0_f32,
5455 altitude_local: 0.0_f32,
5456 altitude_relative: 0.0_f32,
5457 altitude_terrain: 0.0_f32,
5458 bottom_clearance: 0.0_f32,
5459 };
5460 #[cfg(feature = "arbitrary")]
5461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5462 use arbitrary::{Arbitrary, Unstructured};
5463 let mut buf = [0u8; 1024];
5464 rng.fill_bytes(&mut buf);
5465 let mut unstructured = Unstructured::new(&buf);
5466 Self::arbitrary(&mut unstructured).unwrap_or_default()
5467 }
5468}
5469impl Default for ALTITUDE_DATA {
5470 fn default() -> Self {
5471 Self::DEFAULT.clone()
5472 }
5473}
5474impl MessageData for ALTITUDE_DATA {
5475 type Message = MavMessage;
5476 const ID: u32 = 141u32;
5477 const NAME: &'static str = "ALTITUDE";
5478 const EXTRA_CRC: u8 = 47u8;
5479 const ENCODED_LEN: usize = 32usize;
5480 fn deser(
5481 _version: MavlinkVersion,
5482 __input: &[u8],
5483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5484 let avail_len = __input.len();
5485 let mut payload_buf = [0; Self::ENCODED_LEN];
5486 let mut buf = if avail_len < Self::ENCODED_LEN {
5487 payload_buf[0..avail_len].copy_from_slice(__input);
5488 Bytes::new(&payload_buf)
5489 } else {
5490 Bytes::new(__input)
5491 };
5492 let mut __struct = Self::default();
5493 __struct.time_usec = buf.get_u64_le()?;
5494 __struct.altitude_monotonic = buf.get_f32_le()?;
5495 __struct.altitude_amsl = buf.get_f32_le()?;
5496 __struct.altitude_local = buf.get_f32_le()?;
5497 __struct.altitude_relative = buf.get_f32_le()?;
5498 __struct.altitude_terrain = buf.get_f32_le()?;
5499 __struct.bottom_clearance = buf.get_f32_le()?;
5500 Ok(__struct)
5501 }
5502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5503 let mut __tmp = BytesMut::new(bytes);
5504 #[allow(clippy::absurd_extreme_comparisons)]
5505 #[allow(unused_comparisons)]
5506 if __tmp.remaining() < Self::ENCODED_LEN {
5507 panic!(
5508 "buffer is too small (need {} bytes, but got {})",
5509 Self::ENCODED_LEN,
5510 __tmp.remaining(),
5511 )
5512 }
5513 __tmp.put_u64_le(self.time_usec);
5514 __tmp.put_f32_le(self.altitude_monotonic);
5515 __tmp.put_f32_le(self.altitude_amsl);
5516 __tmp.put_f32_le(self.altitude_local);
5517 __tmp.put_f32_le(self.altitude_relative);
5518 __tmp.put_f32_le(self.altitude_terrain);
5519 __tmp.put_f32_le(self.bottom_clearance);
5520 if matches!(version, MavlinkVersion::V2) {
5521 let len = __tmp.len();
5522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5523 } else {
5524 __tmp.len()
5525 }
5526 }
5527}
5528#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5529#[doc = ""]
5530#[doc = "ID: 30"]
5531#[derive(Debug, Clone, PartialEq)]
5532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5534#[cfg_attr(feature = "ts", derive(TS))]
5535#[cfg_attr(feature = "ts", ts(export))]
5536pub struct ATTITUDE_DATA {
5537 #[doc = "Timestamp (time since system boot)."]
5538 pub time_boot_ms: u32,
5539 #[doc = "Roll angle (-pi..+pi)"]
5540 pub roll: f32,
5541 #[doc = "Pitch angle (-pi..+pi)"]
5542 pub pitch: f32,
5543 #[doc = "Yaw angle (-pi..+pi)"]
5544 pub yaw: f32,
5545 #[doc = "Roll angular speed"]
5546 pub rollspeed: f32,
5547 #[doc = "Pitch angular speed"]
5548 pub pitchspeed: f32,
5549 #[doc = "Yaw angular speed"]
5550 pub yawspeed: f32,
5551}
5552impl ATTITUDE_DATA {
5553 pub const ENCODED_LEN: usize = 28usize;
5554 pub const DEFAULT: Self = Self {
5555 time_boot_ms: 0_u32,
5556 roll: 0.0_f32,
5557 pitch: 0.0_f32,
5558 yaw: 0.0_f32,
5559 rollspeed: 0.0_f32,
5560 pitchspeed: 0.0_f32,
5561 yawspeed: 0.0_f32,
5562 };
5563 #[cfg(feature = "arbitrary")]
5564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5565 use arbitrary::{Arbitrary, Unstructured};
5566 let mut buf = [0u8; 1024];
5567 rng.fill_bytes(&mut buf);
5568 let mut unstructured = Unstructured::new(&buf);
5569 Self::arbitrary(&mut unstructured).unwrap_or_default()
5570 }
5571}
5572impl Default for ATTITUDE_DATA {
5573 fn default() -> Self {
5574 Self::DEFAULT.clone()
5575 }
5576}
5577impl MessageData for ATTITUDE_DATA {
5578 type Message = MavMessage;
5579 const ID: u32 = 30u32;
5580 const NAME: &'static str = "ATTITUDE";
5581 const EXTRA_CRC: u8 = 39u8;
5582 const ENCODED_LEN: usize = 28usize;
5583 fn deser(
5584 _version: MavlinkVersion,
5585 __input: &[u8],
5586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5587 let avail_len = __input.len();
5588 let mut payload_buf = [0; Self::ENCODED_LEN];
5589 let mut buf = if avail_len < Self::ENCODED_LEN {
5590 payload_buf[0..avail_len].copy_from_slice(__input);
5591 Bytes::new(&payload_buf)
5592 } else {
5593 Bytes::new(__input)
5594 };
5595 let mut __struct = Self::default();
5596 __struct.time_boot_ms = buf.get_u32_le()?;
5597 __struct.roll = buf.get_f32_le()?;
5598 __struct.pitch = buf.get_f32_le()?;
5599 __struct.yaw = buf.get_f32_le()?;
5600 __struct.rollspeed = buf.get_f32_le()?;
5601 __struct.pitchspeed = buf.get_f32_le()?;
5602 __struct.yawspeed = buf.get_f32_le()?;
5603 Ok(__struct)
5604 }
5605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5606 let mut __tmp = BytesMut::new(bytes);
5607 #[allow(clippy::absurd_extreme_comparisons)]
5608 #[allow(unused_comparisons)]
5609 if __tmp.remaining() < Self::ENCODED_LEN {
5610 panic!(
5611 "buffer is too small (need {} bytes, but got {})",
5612 Self::ENCODED_LEN,
5613 __tmp.remaining(),
5614 )
5615 }
5616 __tmp.put_u32_le(self.time_boot_ms);
5617 __tmp.put_f32_le(self.roll);
5618 __tmp.put_f32_le(self.pitch);
5619 __tmp.put_f32_le(self.yaw);
5620 __tmp.put_f32_le(self.rollspeed);
5621 __tmp.put_f32_le(self.pitchspeed);
5622 __tmp.put_f32_le(self.yawspeed);
5623 if matches!(version, MavlinkVersion::V2) {
5624 let len = __tmp.len();
5625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5626 } else {
5627 __tmp.len()
5628 }
5629 }
5630}
5631#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5632#[doc = ""]
5633#[doc = "ID: 31"]
5634#[derive(Debug, Clone, PartialEq)]
5635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5637#[cfg_attr(feature = "ts", derive(TS))]
5638#[cfg_attr(feature = "ts", ts(export))]
5639pub struct ATTITUDE_QUATERNION_DATA {
5640 #[doc = "Timestamp (time since system boot)."]
5641 pub time_boot_ms: u32,
5642 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5643 pub q1: f32,
5644 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5645 pub q2: f32,
5646 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5647 pub q3: f32,
5648 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5649 pub q4: f32,
5650 #[doc = "Roll angular speed"]
5651 pub rollspeed: f32,
5652 #[doc = "Pitch angular speed"]
5653 pub pitchspeed: f32,
5654 #[doc = "Yaw angular speed"]
5655 pub yawspeed: f32,
5656 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5659 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5660 pub repr_offset_q: [f32; 4],
5661}
5662impl ATTITUDE_QUATERNION_DATA {
5663 pub const ENCODED_LEN: usize = 48usize;
5664 pub const DEFAULT: Self = Self {
5665 time_boot_ms: 0_u32,
5666 q1: 0.0_f32,
5667 q2: 0.0_f32,
5668 q3: 0.0_f32,
5669 q4: 0.0_f32,
5670 rollspeed: 0.0_f32,
5671 pitchspeed: 0.0_f32,
5672 yawspeed: 0.0_f32,
5673 repr_offset_q: [0.0_f32; 4usize],
5674 };
5675 #[cfg(feature = "arbitrary")]
5676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5677 use arbitrary::{Arbitrary, Unstructured};
5678 let mut buf = [0u8; 1024];
5679 rng.fill_bytes(&mut buf);
5680 let mut unstructured = Unstructured::new(&buf);
5681 Self::arbitrary(&mut unstructured).unwrap_or_default()
5682 }
5683}
5684impl Default for ATTITUDE_QUATERNION_DATA {
5685 fn default() -> Self {
5686 Self::DEFAULT.clone()
5687 }
5688}
5689impl MessageData for ATTITUDE_QUATERNION_DATA {
5690 type Message = MavMessage;
5691 const ID: u32 = 31u32;
5692 const NAME: &'static str = "ATTITUDE_QUATERNION";
5693 const EXTRA_CRC: u8 = 246u8;
5694 const ENCODED_LEN: usize = 48usize;
5695 fn deser(
5696 _version: MavlinkVersion,
5697 __input: &[u8],
5698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5699 let avail_len = __input.len();
5700 let mut payload_buf = [0; Self::ENCODED_LEN];
5701 let mut buf = if avail_len < Self::ENCODED_LEN {
5702 payload_buf[0..avail_len].copy_from_slice(__input);
5703 Bytes::new(&payload_buf)
5704 } else {
5705 Bytes::new(__input)
5706 };
5707 let mut __struct = Self::default();
5708 __struct.time_boot_ms = buf.get_u32_le()?;
5709 __struct.q1 = buf.get_f32_le()?;
5710 __struct.q2 = buf.get_f32_le()?;
5711 __struct.q3 = buf.get_f32_le()?;
5712 __struct.q4 = buf.get_f32_le()?;
5713 __struct.rollspeed = buf.get_f32_le()?;
5714 __struct.pitchspeed = buf.get_f32_le()?;
5715 __struct.yawspeed = buf.get_f32_le()?;
5716 for v in &mut __struct.repr_offset_q {
5717 let val = buf.get_f32_le()?;
5718 *v = val;
5719 }
5720 Ok(__struct)
5721 }
5722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5723 let mut __tmp = BytesMut::new(bytes);
5724 #[allow(clippy::absurd_extreme_comparisons)]
5725 #[allow(unused_comparisons)]
5726 if __tmp.remaining() < Self::ENCODED_LEN {
5727 panic!(
5728 "buffer is too small (need {} bytes, but got {})",
5729 Self::ENCODED_LEN,
5730 __tmp.remaining(),
5731 )
5732 }
5733 __tmp.put_u32_le(self.time_boot_ms);
5734 __tmp.put_f32_le(self.q1);
5735 __tmp.put_f32_le(self.q2);
5736 __tmp.put_f32_le(self.q3);
5737 __tmp.put_f32_le(self.q4);
5738 __tmp.put_f32_le(self.rollspeed);
5739 __tmp.put_f32_le(self.pitchspeed);
5740 __tmp.put_f32_le(self.yawspeed);
5741 if matches!(version, MavlinkVersion::V2) {
5742 for val in &self.repr_offset_q {
5743 __tmp.put_f32_le(*val);
5744 }
5745 let len = __tmp.len();
5746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5747 } else {
5748 __tmp.len()
5749 }
5750 }
5751}
5752#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5753#[doc = ""]
5754#[doc = "ID: 61"]
5755#[derive(Debug, Clone, PartialEq)]
5756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5758#[cfg_attr(feature = "ts", derive(TS))]
5759#[cfg_attr(feature = "ts", ts(export))]
5760pub struct ATTITUDE_QUATERNION_COV_DATA {
5761 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5762 pub time_usec: u64,
5763 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5765 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5766 pub q: [f32; 4],
5767 #[doc = "Roll angular speed"]
5768 pub rollspeed: f32,
5769 #[doc = "Pitch angular speed"]
5770 pub pitchspeed: f32,
5771 #[doc = "Yaw angular speed"]
5772 pub yawspeed: f32,
5773 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5774 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5775 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5776 pub covariance: [f32; 9],
5777}
5778impl ATTITUDE_QUATERNION_COV_DATA {
5779 pub const ENCODED_LEN: usize = 72usize;
5780 pub const DEFAULT: Self = Self {
5781 time_usec: 0_u64,
5782 q: [0.0_f32; 4usize],
5783 rollspeed: 0.0_f32,
5784 pitchspeed: 0.0_f32,
5785 yawspeed: 0.0_f32,
5786 covariance: [0.0_f32; 9usize],
5787 };
5788 #[cfg(feature = "arbitrary")]
5789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5790 use arbitrary::{Arbitrary, Unstructured};
5791 let mut buf = [0u8; 1024];
5792 rng.fill_bytes(&mut buf);
5793 let mut unstructured = Unstructured::new(&buf);
5794 Self::arbitrary(&mut unstructured).unwrap_or_default()
5795 }
5796}
5797impl Default for ATTITUDE_QUATERNION_COV_DATA {
5798 fn default() -> Self {
5799 Self::DEFAULT.clone()
5800 }
5801}
5802impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5803 type Message = MavMessage;
5804 const ID: u32 = 61u32;
5805 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5806 const EXTRA_CRC: u8 = 167u8;
5807 const ENCODED_LEN: usize = 72usize;
5808 fn deser(
5809 _version: MavlinkVersion,
5810 __input: &[u8],
5811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5812 let avail_len = __input.len();
5813 let mut payload_buf = [0; Self::ENCODED_LEN];
5814 let mut buf = if avail_len < Self::ENCODED_LEN {
5815 payload_buf[0..avail_len].copy_from_slice(__input);
5816 Bytes::new(&payload_buf)
5817 } else {
5818 Bytes::new(__input)
5819 };
5820 let mut __struct = Self::default();
5821 __struct.time_usec = buf.get_u64_le()?;
5822 for v in &mut __struct.q {
5823 let val = buf.get_f32_le()?;
5824 *v = val;
5825 }
5826 __struct.rollspeed = buf.get_f32_le()?;
5827 __struct.pitchspeed = buf.get_f32_le()?;
5828 __struct.yawspeed = buf.get_f32_le()?;
5829 for v in &mut __struct.covariance {
5830 let val = buf.get_f32_le()?;
5831 *v = val;
5832 }
5833 Ok(__struct)
5834 }
5835 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5836 let mut __tmp = BytesMut::new(bytes);
5837 #[allow(clippy::absurd_extreme_comparisons)]
5838 #[allow(unused_comparisons)]
5839 if __tmp.remaining() < Self::ENCODED_LEN {
5840 panic!(
5841 "buffer is too small (need {} bytes, but got {})",
5842 Self::ENCODED_LEN,
5843 __tmp.remaining(),
5844 )
5845 }
5846 __tmp.put_u64_le(self.time_usec);
5847 for val in &self.q {
5848 __tmp.put_f32_le(*val);
5849 }
5850 __tmp.put_f32_le(self.rollspeed);
5851 __tmp.put_f32_le(self.pitchspeed);
5852 __tmp.put_f32_le(self.yawspeed);
5853 for val in &self.covariance {
5854 __tmp.put_f32_le(*val);
5855 }
5856 if matches!(version, MavlinkVersion::V2) {
5857 let len = __tmp.len();
5858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5859 } else {
5860 __tmp.len()
5861 }
5862 }
5863}
5864#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5865#[doc = ""]
5866#[doc = "ID: 83"]
5867#[derive(Debug, Clone, PartialEq)]
5868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5870#[cfg_attr(feature = "ts", derive(TS))]
5871#[cfg_attr(feature = "ts", ts(export))]
5872pub struct ATTITUDE_TARGET_DATA {
5873 #[doc = "Timestamp (time since system boot)."]
5874 pub time_boot_ms: u32,
5875 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5876 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5877 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5878 pub q: [f32; 4],
5879 #[doc = "Body roll rate"]
5880 pub body_roll_rate: f32,
5881 #[doc = "Body pitch rate"]
5882 pub body_pitch_rate: f32,
5883 #[doc = "Body yaw rate"]
5884 pub body_yaw_rate: f32,
5885 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5886 pub thrust: f32,
5887 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5888 pub type_mask: AttitudeTargetTypemask,
5889}
5890impl ATTITUDE_TARGET_DATA {
5891 pub const ENCODED_LEN: usize = 37usize;
5892 pub const DEFAULT: Self = Self {
5893 time_boot_ms: 0_u32,
5894 q: [0.0_f32; 4usize],
5895 body_roll_rate: 0.0_f32,
5896 body_pitch_rate: 0.0_f32,
5897 body_yaw_rate: 0.0_f32,
5898 thrust: 0.0_f32,
5899 type_mask: AttitudeTargetTypemask::DEFAULT,
5900 };
5901 #[cfg(feature = "arbitrary")]
5902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5903 use arbitrary::{Arbitrary, Unstructured};
5904 let mut buf = [0u8; 1024];
5905 rng.fill_bytes(&mut buf);
5906 let mut unstructured = Unstructured::new(&buf);
5907 Self::arbitrary(&mut unstructured).unwrap_or_default()
5908 }
5909}
5910impl Default for ATTITUDE_TARGET_DATA {
5911 fn default() -> Self {
5912 Self::DEFAULT.clone()
5913 }
5914}
5915impl MessageData for ATTITUDE_TARGET_DATA {
5916 type Message = MavMessage;
5917 const ID: u32 = 83u32;
5918 const NAME: &'static str = "ATTITUDE_TARGET";
5919 const EXTRA_CRC: u8 = 22u8;
5920 const ENCODED_LEN: usize = 37usize;
5921 fn deser(
5922 _version: MavlinkVersion,
5923 __input: &[u8],
5924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5925 let avail_len = __input.len();
5926 let mut payload_buf = [0; Self::ENCODED_LEN];
5927 let mut buf = if avail_len < Self::ENCODED_LEN {
5928 payload_buf[0..avail_len].copy_from_slice(__input);
5929 Bytes::new(&payload_buf)
5930 } else {
5931 Bytes::new(__input)
5932 };
5933 let mut __struct = Self::default();
5934 __struct.time_boot_ms = buf.get_u32_le()?;
5935 for v in &mut __struct.q {
5936 let val = buf.get_f32_le()?;
5937 *v = val;
5938 }
5939 __struct.body_roll_rate = buf.get_f32_le()?;
5940 __struct.body_pitch_rate = buf.get_f32_le()?;
5941 __struct.body_yaw_rate = buf.get_f32_le()?;
5942 __struct.thrust = buf.get_f32_le()?;
5943 let tmp = buf.get_u8()?;
5944 __struct.type_mask =
5945 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
5946 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5947 flag_type: "AttitudeTargetTypemask",
5948 value: tmp as u64,
5949 })?;
5950 Ok(__struct)
5951 }
5952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5953 let mut __tmp = BytesMut::new(bytes);
5954 #[allow(clippy::absurd_extreme_comparisons)]
5955 #[allow(unused_comparisons)]
5956 if __tmp.remaining() < Self::ENCODED_LEN {
5957 panic!(
5958 "buffer is too small (need {} bytes, but got {})",
5959 Self::ENCODED_LEN,
5960 __tmp.remaining(),
5961 )
5962 }
5963 __tmp.put_u32_le(self.time_boot_ms);
5964 for val in &self.q {
5965 __tmp.put_f32_le(*val);
5966 }
5967 __tmp.put_f32_le(self.body_roll_rate);
5968 __tmp.put_f32_le(self.body_pitch_rate);
5969 __tmp.put_f32_le(self.body_yaw_rate);
5970 __tmp.put_f32_le(self.thrust);
5971 __tmp.put_u8(self.type_mask.bits() as u8);
5972 if matches!(version, MavlinkVersion::V2) {
5973 let len = __tmp.len();
5974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5975 } else {
5976 __tmp.len()
5977 }
5978 }
5979}
5980#[doc = "Motion capture attitude and position."]
5981#[doc = ""]
5982#[doc = "ID: 138"]
5983#[derive(Debug, Clone, PartialEq)]
5984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5986#[cfg_attr(feature = "ts", derive(TS))]
5987#[cfg_attr(feature = "ts", ts(export))]
5988pub struct ATT_POS_MOCAP_DATA {
5989 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5990 pub time_usec: u64,
5991 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5992 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5993 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5994 pub q: [f32; 4],
5995 #[doc = "X position (NED)"]
5996 pub x: f32,
5997 #[doc = "Y position (NED)"]
5998 pub y: f32,
5999 #[doc = "Z position (NED)"]
6000 pub z: f32,
6001 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6002 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6003 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6004 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6005 pub covariance: [f32; 21],
6006}
6007impl ATT_POS_MOCAP_DATA {
6008 pub const ENCODED_LEN: usize = 120usize;
6009 pub const DEFAULT: Self = Self {
6010 time_usec: 0_u64,
6011 q: [0.0_f32; 4usize],
6012 x: 0.0_f32,
6013 y: 0.0_f32,
6014 z: 0.0_f32,
6015 covariance: [0.0_f32; 21usize],
6016 };
6017 #[cfg(feature = "arbitrary")]
6018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6019 use arbitrary::{Arbitrary, Unstructured};
6020 let mut buf = [0u8; 1024];
6021 rng.fill_bytes(&mut buf);
6022 let mut unstructured = Unstructured::new(&buf);
6023 Self::arbitrary(&mut unstructured).unwrap_or_default()
6024 }
6025}
6026impl Default for ATT_POS_MOCAP_DATA {
6027 fn default() -> Self {
6028 Self::DEFAULT.clone()
6029 }
6030}
6031impl MessageData for ATT_POS_MOCAP_DATA {
6032 type Message = MavMessage;
6033 const ID: u32 = 138u32;
6034 const NAME: &'static str = "ATT_POS_MOCAP";
6035 const EXTRA_CRC: u8 = 109u8;
6036 const ENCODED_LEN: usize = 120usize;
6037 fn deser(
6038 _version: MavlinkVersion,
6039 __input: &[u8],
6040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6041 let avail_len = __input.len();
6042 let mut payload_buf = [0; Self::ENCODED_LEN];
6043 let mut buf = if avail_len < Self::ENCODED_LEN {
6044 payload_buf[0..avail_len].copy_from_slice(__input);
6045 Bytes::new(&payload_buf)
6046 } else {
6047 Bytes::new(__input)
6048 };
6049 let mut __struct = Self::default();
6050 __struct.time_usec = buf.get_u64_le()?;
6051 for v in &mut __struct.q {
6052 let val = buf.get_f32_le()?;
6053 *v = val;
6054 }
6055 __struct.x = buf.get_f32_le()?;
6056 __struct.y = buf.get_f32_le()?;
6057 __struct.z = buf.get_f32_le()?;
6058 for v in &mut __struct.covariance {
6059 let val = buf.get_f32_le()?;
6060 *v = val;
6061 }
6062 Ok(__struct)
6063 }
6064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6065 let mut __tmp = BytesMut::new(bytes);
6066 #[allow(clippy::absurd_extreme_comparisons)]
6067 #[allow(unused_comparisons)]
6068 if __tmp.remaining() < Self::ENCODED_LEN {
6069 panic!(
6070 "buffer is too small (need {} bytes, but got {})",
6071 Self::ENCODED_LEN,
6072 __tmp.remaining(),
6073 )
6074 }
6075 __tmp.put_u64_le(self.time_usec);
6076 for val in &self.q {
6077 __tmp.put_f32_le(*val);
6078 }
6079 __tmp.put_f32_le(self.x);
6080 __tmp.put_f32_le(self.y);
6081 __tmp.put_f32_le(self.z);
6082 if matches!(version, MavlinkVersion::V2) {
6083 for val in &self.covariance {
6084 __tmp.put_f32_le(*val);
6085 }
6086 let len = __tmp.len();
6087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6088 } else {
6089 __tmp.len()
6090 }
6091 }
6092}
6093#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6094#[doc = ""]
6095#[doc = "ID: 7"]
6096#[derive(Debug, Clone, PartialEq)]
6097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6099#[cfg_attr(feature = "ts", derive(TS))]
6100#[cfg_attr(feature = "ts", ts(export))]
6101pub struct AUTH_KEY_DATA {
6102 #[doc = "key"]
6103 #[cfg_attr(feature = "ts", ts(type = "string"))]
6104 pub key: CharArray<32>,
6105}
6106impl AUTH_KEY_DATA {
6107 pub const ENCODED_LEN: usize = 32usize;
6108 pub const DEFAULT: Self = Self {
6109 key: CharArray::new([0_u8; 32usize]),
6110 };
6111 #[cfg(feature = "arbitrary")]
6112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6113 use arbitrary::{Arbitrary, Unstructured};
6114 let mut buf = [0u8; 1024];
6115 rng.fill_bytes(&mut buf);
6116 let mut unstructured = Unstructured::new(&buf);
6117 Self::arbitrary(&mut unstructured).unwrap_or_default()
6118 }
6119}
6120impl Default for AUTH_KEY_DATA {
6121 fn default() -> Self {
6122 Self::DEFAULT.clone()
6123 }
6124}
6125impl MessageData for AUTH_KEY_DATA {
6126 type Message = MavMessage;
6127 const ID: u32 = 7u32;
6128 const NAME: &'static str = "AUTH_KEY";
6129 const EXTRA_CRC: u8 = 119u8;
6130 const ENCODED_LEN: usize = 32usize;
6131 fn deser(
6132 _version: MavlinkVersion,
6133 __input: &[u8],
6134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6135 let avail_len = __input.len();
6136 let mut payload_buf = [0; Self::ENCODED_LEN];
6137 let mut buf = if avail_len < Self::ENCODED_LEN {
6138 payload_buf[0..avail_len].copy_from_slice(__input);
6139 Bytes::new(&payload_buf)
6140 } else {
6141 Bytes::new(__input)
6142 };
6143 let mut __struct = Self::default();
6144 let mut tmp = [0_u8; 32usize];
6145 for v in &mut tmp {
6146 *v = buf.get_u8()?;
6147 }
6148 __struct.key = CharArray::new(tmp);
6149 Ok(__struct)
6150 }
6151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6152 let mut __tmp = BytesMut::new(bytes);
6153 #[allow(clippy::absurd_extreme_comparisons)]
6154 #[allow(unused_comparisons)]
6155 if __tmp.remaining() < Self::ENCODED_LEN {
6156 panic!(
6157 "buffer is too small (need {} bytes, but got {})",
6158 Self::ENCODED_LEN,
6159 __tmp.remaining(),
6160 )
6161 }
6162 for val in &self.key {
6163 __tmp.put_u8(*val);
6164 }
6165 if matches!(version, MavlinkVersion::V2) {
6166 let len = __tmp.len();
6167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6168 } else {
6169 __tmp.len()
6170 }
6171 }
6172}
6173#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6174#[doc = ""]
6175#[doc = "ID: 286"]
6176#[derive(Debug, Clone, PartialEq)]
6177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6179#[cfg_attr(feature = "ts", derive(TS))]
6180#[cfg_attr(feature = "ts", ts(export))]
6181pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6182 #[doc = "Timestamp (time since system boot)."]
6183 pub time_boot_us: u64,
6184 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6186 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6187 pub q: [f32; 4],
6188 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6189 pub q_estimated_delay_us: u32,
6190 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6191 pub vx: f32,
6192 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6193 pub vy: f32,
6194 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6195 pub vz: f32,
6196 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6197 pub v_estimated_delay_us: u32,
6198 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6199 pub feed_forward_angular_velocity_z: f32,
6200 #[doc = "Bitmap indicating which estimator outputs are valid."]
6201 pub estimator_status: EstimatorStatusFlags,
6202 #[doc = "System ID"]
6203 pub target_system: u8,
6204 #[doc = "Component ID"]
6205 pub target_component: u8,
6206 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6207 pub landed_state: MavLandedState,
6208 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6209 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6210 pub angular_velocity_z: f32,
6211}
6212impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6213 pub const ENCODED_LEN: usize = 57usize;
6214 pub const DEFAULT: Self = Self {
6215 time_boot_us: 0_u64,
6216 q: [0.0_f32; 4usize],
6217 q_estimated_delay_us: 0_u32,
6218 vx: 0.0_f32,
6219 vy: 0.0_f32,
6220 vz: 0.0_f32,
6221 v_estimated_delay_us: 0_u32,
6222 feed_forward_angular_velocity_z: 0.0_f32,
6223 estimator_status: EstimatorStatusFlags::DEFAULT,
6224 target_system: 0_u8,
6225 target_component: 0_u8,
6226 landed_state: MavLandedState::DEFAULT,
6227 angular_velocity_z: 0.0_f32,
6228 };
6229 #[cfg(feature = "arbitrary")]
6230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6231 use arbitrary::{Arbitrary, Unstructured};
6232 let mut buf = [0u8; 1024];
6233 rng.fill_bytes(&mut buf);
6234 let mut unstructured = Unstructured::new(&buf);
6235 Self::arbitrary(&mut unstructured).unwrap_or_default()
6236 }
6237}
6238impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6239 fn default() -> Self {
6240 Self::DEFAULT.clone()
6241 }
6242}
6243impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6244 type Message = MavMessage;
6245 const ID: u32 = 286u32;
6246 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6247 const EXTRA_CRC: u8 = 210u8;
6248 const ENCODED_LEN: usize = 57usize;
6249 fn deser(
6250 _version: MavlinkVersion,
6251 __input: &[u8],
6252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6253 let avail_len = __input.len();
6254 let mut payload_buf = [0; Self::ENCODED_LEN];
6255 let mut buf = if avail_len < Self::ENCODED_LEN {
6256 payload_buf[0..avail_len].copy_from_slice(__input);
6257 Bytes::new(&payload_buf)
6258 } else {
6259 Bytes::new(__input)
6260 };
6261 let mut __struct = Self::default();
6262 __struct.time_boot_us = buf.get_u64_le()?;
6263 for v in &mut __struct.q {
6264 let val = buf.get_f32_le()?;
6265 *v = val;
6266 }
6267 __struct.q_estimated_delay_us = buf.get_u32_le()?;
6268 __struct.vx = buf.get_f32_le()?;
6269 __struct.vy = buf.get_f32_le()?;
6270 __struct.vz = buf.get_f32_le()?;
6271 __struct.v_estimated_delay_us = buf.get_u32_le()?;
6272 __struct.feed_forward_angular_velocity_z = buf.get_f32_le()?;
6273 let tmp = buf.get_u16_le()?;
6274 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6275 tmp as <EstimatorStatusFlags as Flags>::Bits,
6276 )
6277 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6278 flag_type: "EstimatorStatusFlags",
6279 value: tmp as u64,
6280 })?;
6281 __struct.target_system = buf.get_u8()?;
6282 __struct.target_component = buf.get_u8()?;
6283 let tmp = buf.get_u8()?;
6284 __struct.landed_state =
6285 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6286 enum_type: "MavLandedState",
6287 value: tmp as u64,
6288 })?;
6289 __struct.angular_velocity_z = buf.get_f32_le()?;
6290 Ok(__struct)
6291 }
6292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6293 let mut __tmp = BytesMut::new(bytes);
6294 #[allow(clippy::absurd_extreme_comparisons)]
6295 #[allow(unused_comparisons)]
6296 if __tmp.remaining() < Self::ENCODED_LEN {
6297 panic!(
6298 "buffer is too small (need {} bytes, but got {})",
6299 Self::ENCODED_LEN,
6300 __tmp.remaining(),
6301 )
6302 }
6303 __tmp.put_u64_le(self.time_boot_us);
6304 for val in &self.q {
6305 __tmp.put_f32_le(*val);
6306 }
6307 __tmp.put_u32_le(self.q_estimated_delay_us);
6308 __tmp.put_f32_le(self.vx);
6309 __tmp.put_f32_le(self.vy);
6310 __tmp.put_f32_le(self.vz);
6311 __tmp.put_u32_le(self.v_estimated_delay_us);
6312 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6313 __tmp.put_u16_le(self.estimator_status.bits() as u16);
6314 __tmp.put_u8(self.target_system);
6315 __tmp.put_u8(self.target_component);
6316 __tmp.put_u8(self.landed_state as u8);
6317 if matches!(version, MavlinkVersion::V2) {
6318 __tmp.put_f32_le(self.angular_velocity_z);
6319 let len = __tmp.len();
6320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6321 } else {
6322 __tmp.len()
6323 }
6324 }
6325}
6326#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6327#[doc = ""]
6328#[doc = "ID: 148"]
6329#[derive(Debug, Clone, PartialEq)]
6330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6332#[cfg_attr(feature = "ts", derive(TS))]
6333#[cfg_attr(feature = "ts", ts(export))]
6334pub struct AUTOPILOT_VERSION_DATA {
6335 #[doc = "Bitmap of capabilities"]
6336 pub capabilities: MavProtocolCapability,
6337 #[doc = "UID if provided by hardware (see uid2)"]
6338 pub uid: u64,
6339 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6340 pub flight_sw_version: u32,
6341 #[doc = "Middleware version number"]
6342 pub middleware_sw_version: u32,
6343 #[doc = "Operating system version number"]
6344 pub os_sw_version: u32,
6345 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6346 pub board_version: u32,
6347 #[doc = "ID of the board vendor"]
6348 pub vendor_id: u16,
6349 #[doc = "ID of the product"]
6350 pub product_id: u16,
6351 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6353 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6354 pub flight_custom_version: [u8; 8],
6355 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6356 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6357 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6358 pub middleware_custom_version: [u8; 8],
6359 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6360 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6361 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6362 pub os_custom_version: [u8; 8],
6363 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6365 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6366 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6367 pub uid2: [u8; 18],
6368}
6369impl AUTOPILOT_VERSION_DATA {
6370 pub const ENCODED_LEN: usize = 78usize;
6371 pub const DEFAULT: Self = Self {
6372 capabilities: MavProtocolCapability::DEFAULT,
6373 uid: 0_u64,
6374 flight_sw_version: 0_u32,
6375 middleware_sw_version: 0_u32,
6376 os_sw_version: 0_u32,
6377 board_version: 0_u32,
6378 vendor_id: 0_u16,
6379 product_id: 0_u16,
6380 flight_custom_version: [0_u8; 8usize],
6381 middleware_custom_version: [0_u8; 8usize],
6382 os_custom_version: [0_u8; 8usize],
6383 uid2: [0_u8; 18usize],
6384 };
6385 #[cfg(feature = "arbitrary")]
6386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6387 use arbitrary::{Arbitrary, Unstructured};
6388 let mut buf = [0u8; 1024];
6389 rng.fill_bytes(&mut buf);
6390 let mut unstructured = Unstructured::new(&buf);
6391 Self::arbitrary(&mut unstructured).unwrap_or_default()
6392 }
6393}
6394impl Default for AUTOPILOT_VERSION_DATA {
6395 fn default() -> Self {
6396 Self::DEFAULT.clone()
6397 }
6398}
6399impl MessageData for AUTOPILOT_VERSION_DATA {
6400 type Message = MavMessage;
6401 const ID: u32 = 148u32;
6402 const NAME: &'static str = "AUTOPILOT_VERSION";
6403 const EXTRA_CRC: u8 = 178u8;
6404 const ENCODED_LEN: usize = 78usize;
6405 fn deser(
6406 _version: MavlinkVersion,
6407 __input: &[u8],
6408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6409 let avail_len = __input.len();
6410 let mut payload_buf = [0; Self::ENCODED_LEN];
6411 let mut buf = if avail_len < Self::ENCODED_LEN {
6412 payload_buf[0..avail_len].copy_from_slice(__input);
6413 Bytes::new(&payload_buf)
6414 } else {
6415 Bytes::new(__input)
6416 };
6417 let mut __struct = Self::default();
6418 let tmp = buf.get_u64_le()?;
6419 __struct.capabilities = MavProtocolCapability::from_bits(
6420 tmp as <MavProtocolCapability as Flags>::Bits,
6421 )
6422 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6423 flag_type: "MavProtocolCapability",
6424 value: tmp as u64,
6425 })?;
6426 __struct.uid = buf.get_u64_le()?;
6427 __struct.flight_sw_version = buf.get_u32_le()?;
6428 __struct.middleware_sw_version = buf.get_u32_le()?;
6429 __struct.os_sw_version = buf.get_u32_le()?;
6430 __struct.board_version = buf.get_u32_le()?;
6431 __struct.vendor_id = buf.get_u16_le()?;
6432 __struct.product_id = buf.get_u16_le()?;
6433 for v in &mut __struct.flight_custom_version {
6434 let val = buf.get_u8()?;
6435 *v = val;
6436 }
6437 for v in &mut __struct.middleware_custom_version {
6438 let val = buf.get_u8()?;
6439 *v = val;
6440 }
6441 for v in &mut __struct.os_custom_version {
6442 let val = buf.get_u8()?;
6443 *v = val;
6444 }
6445 for v in &mut __struct.uid2 {
6446 let val = buf.get_u8()?;
6447 *v = val;
6448 }
6449 Ok(__struct)
6450 }
6451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6452 let mut __tmp = BytesMut::new(bytes);
6453 #[allow(clippy::absurd_extreme_comparisons)]
6454 #[allow(unused_comparisons)]
6455 if __tmp.remaining() < Self::ENCODED_LEN {
6456 panic!(
6457 "buffer is too small (need {} bytes, but got {})",
6458 Self::ENCODED_LEN,
6459 __tmp.remaining(),
6460 )
6461 }
6462 __tmp.put_u64_le(self.capabilities.bits() as u64);
6463 __tmp.put_u64_le(self.uid);
6464 __tmp.put_u32_le(self.flight_sw_version);
6465 __tmp.put_u32_le(self.middleware_sw_version);
6466 __tmp.put_u32_le(self.os_sw_version);
6467 __tmp.put_u32_le(self.board_version);
6468 __tmp.put_u16_le(self.vendor_id);
6469 __tmp.put_u16_le(self.product_id);
6470 for val in &self.flight_custom_version {
6471 __tmp.put_u8(*val);
6472 }
6473 for val in &self.middleware_custom_version {
6474 __tmp.put_u8(*val);
6475 }
6476 for val in &self.os_custom_version {
6477 __tmp.put_u8(*val);
6478 }
6479 if matches!(version, MavlinkVersion::V2) {
6480 for val in &self.uid2 {
6481 __tmp.put_u8(*val);
6482 }
6483 let len = __tmp.len();
6484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6485 } else {
6486 __tmp.len()
6487 }
6488 }
6489}
6490#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6491#[doc = ""]
6492#[doc = "ID: 435"]
6493#[derive(Debug, Clone, PartialEq)]
6494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6496#[cfg_attr(feature = "ts", derive(TS))]
6497#[cfg_attr(feature = "ts", ts(export))]
6498pub struct AVAILABLE_MODES_DATA {
6499 #[doc = "A bitfield for use for autopilot-specific flags"]
6500 pub custom_mode: u32,
6501 #[doc = "Mode properties."]
6502 pub properties: MavModeProperty,
6503 #[doc = "The total number of available modes for the current vehicle type."]
6504 pub number_modes: u8,
6505 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6506 pub mode_index: u8,
6507 #[doc = "Standard mode."]
6508 pub standard_mode: MavStandardMode,
6509 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6510 #[cfg_attr(feature = "ts", ts(type = "string"))]
6511 pub mode_name: CharArray<35>,
6512}
6513impl AVAILABLE_MODES_DATA {
6514 pub const ENCODED_LEN: usize = 46usize;
6515 pub const DEFAULT: Self = Self {
6516 custom_mode: 0_u32,
6517 properties: MavModeProperty::DEFAULT,
6518 number_modes: 0_u8,
6519 mode_index: 0_u8,
6520 standard_mode: MavStandardMode::DEFAULT,
6521 mode_name: CharArray::new([0_u8; 35usize]),
6522 };
6523 #[cfg(feature = "arbitrary")]
6524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6525 use arbitrary::{Arbitrary, Unstructured};
6526 let mut buf = [0u8; 1024];
6527 rng.fill_bytes(&mut buf);
6528 let mut unstructured = Unstructured::new(&buf);
6529 Self::arbitrary(&mut unstructured).unwrap_or_default()
6530 }
6531}
6532impl Default for AVAILABLE_MODES_DATA {
6533 fn default() -> Self {
6534 Self::DEFAULT.clone()
6535 }
6536}
6537impl MessageData for AVAILABLE_MODES_DATA {
6538 type Message = MavMessage;
6539 const ID: u32 = 435u32;
6540 const NAME: &'static str = "AVAILABLE_MODES";
6541 const EXTRA_CRC: u8 = 134u8;
6542 const ENCODED_LEN: usize = 46usize;
6543 fn deser(
6544 _version: MavlinkVersion,
6545 __input: &[u8],
6546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6547 let avail_len = __input.len();
6548 let mut payload_buf = [0; Self::ENCODED_LEN];
6549 let mut buf = if avail_len < Self::ENCODED_LEN {
6550 payload_buf[0..avail_len].copy_from_slice(__input);
6551 Bytes::new(&payload_buf)
6552 } else {
6553 Bytes::new(__input)
6554 };
6555 let mut __struct = Self::default();
6556 __struct.custom_mode = buf.get_u32_le()?;
6557 let tmp = buf.get_u32_le()?;
6558 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
6559 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6560 flag_type: "MavModeProperty",
6561 value: tmp as u64,
6562 })?;
6563 __struct.number_modes = buf.get_u8()?;
6564 __struct.mode_index = buf.get_u8()?;
6565 let tmp = buf.get_u8()?;
6566 __struct.standard_mode =
6567 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6568 enum_type: "MavStandardMode",
6569 value: tmp as u64,
6570 })?;
6571 let mut tmp = [0_u8; 35usize];
6572 for v in &mut tmp {
6573 *v = buf.get_u8()?;
6574 }
6575 __struct.mode_name = CharArray::new(tmp);
6576 Ok(__struct)
6577 }
6578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6579 let mut __tmp = BytesMut::new(bytes);
6580 #[allow(clippy::absurd_extreme_comparisons)]
6581 #[allow(unused_comparisons)]
6582 if __tmp.remaining() < Self::ENCODED_LEN {
6583 panic!(
6584 "buffer is too small (need {} bytes, but got {})",
6585 Self::ENCODED_LEN,
6586 __tmp.remaining(),
6587 )
6588 }
6589 __tmp.put_u32_le(self.custom_mode);
6590 __tmp.put_u32_le(self.properties.bits() as u32);
6591 __tmp.put_u8(self.number_modes);
6592 __tmp.put_u8(self.mode_index);
6593 __tmp.put_u8(self.standard_mode as u8);
6594 for val in &self.mode_name {
6595 __tmp.put_u8(*val);
6596 }
6597 if matches!(version, MavlinkVersion::V2) {
6598 let len = __tmp.len();
6599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6600 } else {
6601 __tmp.len()
6602 }
6603 }
6604}
6605#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6606#[doc = ""]
6607#[doc = "ID: 437"]
6608#[derive(Debug, Clone, PartialEq)]
6609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6611#[cfg_attr(feature = "ts", derive(TS))]
6612#[cfg_attr(feature = "ts", ts(export))]
6613pub struct AVAILABLE_MODES_MONITOR_DATA {
6614 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6615 pub seq: u8,
6616}
6617impl AVAILABLE_MODES_MONITOR_DATA {
6618 pub const ENCODED_LEN: usize = 1usize;
6619 pub const DEFAULT: Self = Self { seq: 0_u8 };
6620 #[cfg(feature = "arbitrary")]
6621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6622 use arbitrary::{Arbitrary, Unstructured};
6623 let mut buf = [0u8; 1024];
6624 rng.fill_bytes(&mut buf);
6625 let mut unstructured = Unstructured::new(&buf);
6626 Self::arbitrary(&mut unstructured).unwrap_or_default()
6627 }
6628}
6629impl Default for AVAILABLE_MODES_MONITOR_DATA {
6630 fn default() -> Self {
6631 Self::DEFAULT.clone()
6632 }
6633}
6634impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6635 type Message = MavMessage;
6636 const ID: u32 = 437u32;
6637 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6638 const EXTRA_CRC: u8 = 30u8;
6639 const ENCODED_LEN: usize = 1usize;
6640 fn deser(
6641 _version: MavlinkVersion,
6642 __input: &[u8],
6643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6644 let avail_len = __input.len();
6645 let mut payload_buf = [0; Self::ENCODED_LEN];
6646 let mut buf = if avail_len < Self::ENCODED_LEN {
6647 payload_buf[0..avail_len].copy_from_slice(__input);
6648 Bytes::new(&payload_buf)
6649 } else {
6650 Bytes::new(__input)
6651 };
6652 let mut __struct = Self::default();
6653 __struct.seq = buf.get_u8()?;
6654 Ok(__struct)
6655 }
6656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6657 let mut __tmp = BytesMut::new(bytes);
6658 #[allow(clippy::absurd_extreme_comparisons)]
6659 #[allow(unused_comparisons)]
6660 if __tmp.remaining() < Self::ENCODED_LEN {
6661 panic!(
6662 "buffer is too small (need {} bytes, but got {})",
6663 Self::ENCODED_LEN,
6664 __tmp.remaining(),
6665 )
6666 }
6667 __tmp.put_u8(self.seq);
6668 if matches!(version, MavlinkVersion::V2) {
6669 let len = __tmp.len();
6670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6671 } else {
6672 __tmp.len()
6673 }
6674 }
6675}
6676#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6677#[doc = ""]
6678#[doc = "ID: 372"]
6679#[derive(Debug, Clone, PartialEq)]
6680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6682#[cfg_attr(feature = "ts", derive(TS))]
6683#[cfg_attr(feature = "ts", ts(export))]
6684pub struct BATTERY_INFO_DATA {
6685 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6686 pub discharge_minimum_voltage: f32,
6687 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6688 pub charging_minimum_voltage: f32,
6689 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6690 pub resting_minimum_voltage: f32,
6691 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6692 pub charging_maximum_voltage: f32,
6693 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6694 pub charging_maximum_current: f32,
6695 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6696 pub nominal_voltage: f32,
6697 #[doc = "Maximum pack discharge current. 0: field not provided."]
6698 pub discharge_maximum_current: f32,
6699 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6700 pub discharge_maximum_burst_current: f32,
6701 #[doc = "Fully charged design capacity. 0: field not provided."]
6702 pub design_capacity: f32,
6703 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6704 pub full_charge_capacity: f32,
6705 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6706 pub cycle_count: u16,
6707 #[doc = "Battery weight. 0: field not provided."]
6708 pub weight: u16,
6709 #[doc = "Battery ID"]
6710 pub id: u8,
6711 #[doc = "Function of the battery."]
6712 pub battery_function: MavBatteryFunction,
6713 #[doc = "Type (chemistry) of the battery."]
6714 pub mavtype: MavBatteryType,
6715 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6716 pub state_of_health: u8,
6717 #[doc = "Number of battery cells in series. 0: field not provided."]
6718 pub cells_in_series: u8,
6719 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6720 #[cfg_attr(feature = "ts", ts(type = "string"))]
6721 pub manufacture_date: CharArray<9>,
6722 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6723 #[cfg_attr(feature = "ts", ts(type = "string"))]
6724 pub serial_number: CharArray<32>,
6725 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6726 #[cfg_attr(feature = "ts", ts(type = "string"))]
6727 pub name: CharArray<50>,
6728}
6729impl BATTERY_INFO_DATA {
6730 pub const ENCODED_LEN: usize = 140usize;
6731 pub const DEFAULT: Self = Self {
6732 discharge_minimum_voltage: 0.0_f32,
6733 charging_minimum_voltage: 0.0_f32,
6734 resting_minimum_voltage: 0.0_f32,
6735 charging_maximum_voltage: 0.0_f32,
6736 charging_maximum_current: 0.0_f32,
6737 nominal_voltage: 0.0_f32,
6738 discharge_maximum_current: 0.0_f32,
6739 discharge_maximum_burst_current: 0.0_f32,
6740 design_capacity: 0.0_f32,
6741 full_charge_capacity: 0.0_f32,
6742 cycle_count: 0_u16,
6743 weight: 0_u16,
6744 id: 0_u8,
6745 battery_function: MavBatteryFunction::DEFAULT,
6746 mavtype: MavBatteryType::DEFAULT,
6747 state_of_health: 0_u8,
6748 cells_in_series: 0_u8,
6749 manufacture_date: CharArray::new([0_u8; 9usize]),
6750 serial_number: CharArray::new([0_u8; 32usize]),
6751 name: CharArray::new([0_u8; 50usize]),
6752 };
6753 #[cfg(feature = "arbitrary")]
6754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6755 use arbitrary::{Arbitrary, Unstructured};
6756 let mut buf = [0u8; 1024];
6757 rng.fill_bytes(&mut buf);
6758 let mut unstructured = Unstructured::new(&buf);
6759 Self::arbitrary(&mut unstructured).unwrap_or_default()
6760 }
6761}
6762impl Default for BATTERY_INFO_DATA {
6763 fn default() -> Self {
6764 Self::DEFAULT.clone()
6765 }
6766}
6767impl MessageData for BATTERY_INFO_DATA {
6768 type Message = MavMessage;
6769 const ID: u32 = 372u32;
6770 const NAME: &'static str = "BATTERY_INFO";
6771 const EXTRA_CRC: u8 = 26u8;
6772 const ENCODED_LEN: usize = 140usize;
6773 fn deser(
6774 _version: MavlinkVersion,
6775 __input: &[u8],
6776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6777 let avail_len = __input.len();
6778 let mut payload_buf = [0; Self::ENCODED_LEN];
6779 let mut buf = if avail_len < Self::ENCODED_LEN {
6780 payload_buf[0..avail_len].copy_from_slice(__input);
6781 Bytes::new(&payload_buf)
6782 } else {
6783 Bytes::new(__input)
6784 };
6785 let mut __struct = Self::default();
6786 __struct.discharge_minimum_voltage = buf.get_f32_le()?;
6787 __struct.charging_minimum_voltage = buf.get_f32_le()?;
6788 __struct.resting_minimum_voltage = buf.get_f32_le()?;
6789 __struct.charging_maximum_voltage = buf.get_f32_le()?;
6790 __struct.charging_maximum_current = buf.get_f32_le()?;
6791 __struct.nominal_voltage = buf.get_f32_le()?;
6792 __struct.discharge_maximum_current = buf.get_f32_le()?;
6793 __struct.discharge_maximum_burst_current = buf.get_f32_le()?;
6794 __struct.design_capacity = buf.get_f32_le()?;
6795 __struct.full_charge_capacity = buf.get_f32_le()?;
6796 __struct.cycle_count = buf.get_u16_le()?;
6797 __struct.weight = buf.get_u16_le()?;
6798 __struct.id = buf.get_u8()?;
6799 let tmp = buf.get_u8()?;
6800 __struct.battery_function =
6801 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6802 enum_type: "MavBatteryFunction",
6803 value: tmp as u64,
6804 })?;
6805 let tmp = buf.get_u8()?;
6806 __struct.mavtype =
6807 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6808 enum_type: "MavBatteryType",
6809 value: tmp as u64,
6810 })?;
6811 __struct.state_of_health = buf.get_u8()?;
6812 __struct.cells_in_series = buf.get_u8()?;
6813 let mut tmp = [0_u8; 9usize];
6814 for v in &mut tmp {
6815 *v = buf.get_u8()?;
6816 }
6817 __struct.manufacture_date = CharArray::new(tmp);
6818 let mut tmp = [0_u8; 32usize];
6819 for v in &mut tmp {
6820 *v = buf.get_u8()?;
6821 }
6822 __struct.serial_number = CharArray::new(tmp);
6823 let mut tmp = [0_u8; 50usize];
6824 for v in &mut tmp {
6825 *v = buf.get_u8()?;
6826 }
6827 __struct.name = CharArray::new(tmp);
6828 Ok(__struct)
6829 }
6830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6831 let mut __tmp = BytesMut::new(bytes);
6832 #[allow(clippy::absurd_extreme_comparisons)]
6833 #[allow(unused_comparisons)]
6834 if __tmp.remaining() < Self::ENCODED_LEN {
6835 panic!(
6836 "buffer is too small (need {} bytes, but got {})",
6837 Self::ENCODED_LEN,
6838 __tmp.remaining(),
6839 )
6840 }
6841 __tmp.put_f32_le(self.discharge_minimum_voltage);
6842 __tmp.put_f32_le(self.charging_minimum_voltage);
6843 __tmp.put_f32_le(self.resting_minimum_voltage);
6844 __tmp.put_f32_le(self.charging_maximum_voltage);
6845 __tmp.put_f32_le(self.charging_maximum_current);
6846 __tmp.put_f32_le(self.nominal_voltage);
6847 __tmp.put_f32_le(self.discharge_maximum_current);
6848 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6849 __tmp.put_f32_le(self.design_capacity);
6850 __tmp.put_f32_le(self.full_charge_capacity);
6851 __tmp.put_u16_le(self.cycle_count);
6852 __tmp.put_u16_le(self.weight);
6853 __tmp.put_u8(self.id);
6854 __tmp.put_u8(self.battery_function as u8);
6855 __tmp.put_u8(self.mavtype as u8);
6856 __tmp.put_u8(self.state_of_health);
6857 __tmp.put_u8(self.cells_in_series);
6858 for val in &self.manufacture_date {
6859 __tmp.put_u8(*val);
6860 }
6861 for val in &self.serial_number {
6862 __tmp.put_u8(*val);
6863 }
6864 for val in &self.name {
6865 __tmp.put_u8(*val);
6866 }
6867 if matches!(version, MavlinkVersion::V2) {
6868 let len = __tmp.len();
6869 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6870 } else {
6871 __tmp.len()
6872 }
6873 }
6874}
6875#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6876#[doc = ""]
6877#[doc = "ID: 147"]
6878#[derive(Debug, Clone, PartialEq)]
6879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6881#[cfg_attr(feature = "ts", derive(TS))]
6882#[cfg_attr(feature = "ts", ts(export))]
6883pub struct BATTERY_STATUS_DATA {
6884 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6885 pub current_consumed: i32,
6886 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6887 pub energy_consumed: i32,
6888 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6889 pub temperature: i16,
6890 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6891 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6892 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6893 pub voltages: [u16; 10],
6894 #[doc = "Battery current, -1: autopilot does not measure the current"]
6895 pub current_battery: i16,
6896 #[doc = "Battery ID"]
6897 pub id: u8,
6898 #[doc = "Function of the battery"]
6899 pub battery_function: MavBatteryFunction,
6900 #[doc = "Type (chemistry) of the battery"]
6901 pub mavtype: MavBatteryType,
6902 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6903 pub battery_remaining: i8,
6904 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6906 pub time_remaining: i32,
6907 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6908 #[cfg_attr(feature = "serde", serde(default))]
6909 pub charge_state: MavBatteryChargeState,
6910 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6911 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6912 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6913 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6914 pub voltages_ext: [u16; 4],
6915 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6916 #[cfg_attr(feature = "serde", serde(default))]
6917 pub mode: MavBatteryMode,
6918 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6919 #[cfg_attr(feature = "serde", serde(default))]
6920 pub fault_bitmask: MavBatteryFault,
6921}
6922impl BATTERY_STATUS_DATA {
6923 pub const ENCODED_LEN: usize = 54usize;
6924 pub const DEFAULT: Self = Self {
6925 current_consumed: 0_i32,
6926 energy_consumed: 0_i32,
6927 temperature: 0_i16,
6928 voltages: [0_u16; 10usize],
6929 current_battery: 0_i16,
6930 id: 0_u8,
6931 battery_function: MavBatteryFunction::DEFAULT,
6932 mavtype: MavBatteryType::DEFAULT,
6933 battery_remaining: 0_i8,
6934 time_remaining: 0_i32,
6935 charge_state: MavBatteryChargeState::DEFAULT,
6936 voltages_ext: [0_u16; 4usize],
6937 mode: MavBatteryMode::DEFAULT,
6938 fault_bitmask: MavBatteryFault::DEFAULT,
6939 };
6940 #[cfg(feature = "arbitrary")]
6941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6942 use arbitrary::{Arbitrary, Unstructured};
6943 let mut buf = [0u8; 1024];
6944 rng.fill_bytes(&mut buf);
6945 let mut unstructured = Unstructured::new(&buf);
6946 Self::arbitrary(&mut unstructured).unwrap_or_default()
6947 }
6948}
6949impl Default for BATTERY_STATUS_DATA {
6950 fn default() -> Self {
6951 Self::DEFAULT.clone()
6952 }
6953}
6954impl MessageData for BATTERY_STATUS_DATA {
6955 type Message = MavMessage;
6956 const ID: u32 = 147u32;
6957 const NAME: &'static str = "BATTERY_STATUS";
6958 const EXTRA_CRC: u8 = 154u8;
6959 const ENCODED_LEN: usize = 54usize;
6960 fn deser(
6961 _version: MavlinkVersion,
6962 __input: &[u8],
6963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6964 let avail_len = __input.len();
6965 let mut payload_buf = [0; Self::ENCODED_LEN];
6966 let mut buf = if avail_len < Self::ENCODED_LEN {
6967 payload_buf[0..avail_len].copy_from_slice(__input);
6968 Bytes::new(&payload_buf)
6969 } else {
6970 Bytes::new(__input)
6971 };
6972 let mut __struct = Self::default();
6973 __struct.current_consumed = buf.get_i32_le()?;
6974 __struct.energy_consumed = buf.get_i32_le()?;
6975 __struct.temperature = buf.get_i16_le()?;
6976 for v in &mut __struct.voltages {
6977 let val = buf.get_u16_le()?;
6978 *v = val;
6979 }
6980 __struct.current_battery = buf.get_i16_le()?;
6981 __struct.id = buf.get_u8()?;
6982 let tmp = buf.get_u8()?;
6983 __struct.battery_function =
6984 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6985 enum_type: "MavBatteryFunction",
6986 value: tmp as u64,
6987 })?;
6988 let tmp = buf.get_u8()?;
6989 __struct.mavtype =
6990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6991 enum_type: "MavBatteryType",
6992 value: tmp as u64,
6993 })?;
6994 __struct.battery_remaining = buf.get_i8()?;
6995 __struct.time_remaining = buf.get_i32_le()?;
6996 let tmp = buf.get_u8()?;
6997 __struct.charge_state =
6998 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6999 enum_type: "MavBatteryChargeState",
7000 value: tmp as u64,
7001 })?;
7002 for v in &mut __struct.voltages_ext {
7003 let val = buf.get_u16_le()?;
7004 *v = val;
7005 }
7006 let tmp = buf.get_u8()?;
7007 __struct.mode =
7008 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7009 enum_type: "MavBatteryMode",
7010 value: tmp as u64,
7011 })?;
7012 let tmp = buf.get_u32_le()?;
7013 __struct.fault_bitmask = MavBatteryFault::from_bits(
7014 tmp as <MavBatteryFault as Flags>::Bits,
7015 )
7016 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7017 flag_type: "MavBatteryFault",
7018 value: tmp as u64,
7019 })?;
7020 Ok(__struct)
7021 }
7022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7023 let mut __tmp = BytesMut::new(bytes);
7024 #[allow(clippy::absurd_extreme_comparisons)]
7025 #[allow(unused_comparisons)]
7026 if __tmp.remaining() < Self::ENCODED_LEN {
7027 panic!(
7028 "buffer is too small (need {} bytes, but got {})",
7029 Self::ENCODED_LEN,
7030 __tmp.remaining(),
7031 )
7032 }
7033 __tmp.put_i32_le(self.current_consumed);
7034 __tmp.put_i32_le(self.energy_consumed);
7035 __tmp.put_i16_le(self.temperature);
7036 for val in &self.voltages {
7037 __tmp.put_u16_le(*val);
7038 }
7039 __tmp.put_i16_le(self.current_battery);
7040 __tmp.put_u8(self.id);
7041 __tmp.put_u8(self.battery_function as u8);
7042 __tmp.put_u8(self.mavtype as u8);
7043 __tmp.put_i8(self.battery_remaining);
7044 if matches!(version, MavlinkVersion::V2) {
7045 __tmp.put_i32_le(self.time_remaining);
7046 __tmp.put_u8(self.charge_state as u8);
7047 for val in &self.voltages_ext {
7048 __tmp.put_u16_le(*val);
7049 }
7050 __tmp.put_u8(self.mode as u8);
7051 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
7052 let len = __tmp.len();
7053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7054 } else {
7055 __tmp.len()
7056 }
7057 }
7058}
7059#[doc = "Report button state change."]
7060#[doc = ""]
7061#[doc = "ID: 257"]
7062#[derive(Debug, Clone, PartialEq)]
7063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7065#[cfg_attr(feature = "ts", derive(TS))]
7066#[cfg_attr(feature = "ts", ts(export))]
7067pub struct BUTTON_CHANGE_DATA {
7068 #[doc = "Timestamp (time since system boot)."]
7069 pub time_boot_ms: u32,
7070 #[doc = "Time of last change of button state."]
7071 pub last_change_ms: u32,
7072 #[doc = "Bitmap for state of buttons."]
7073 pub state: u8,
7074}
7075impl BUTTON_CHANGE_DATA {
7076 pub const ENCODED_LEN: usize = 9usize;
7077 pub const DEFAULT: Self = Self {
7078 time_boot_ms: 0_u32,
7079 last_change_ms: 0_u32,
7080 state: 0_u8,
7081 };
7082 #[cfg(feature = "arbitrary")]
7083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7084 use arbitrary::{Arbitrary, Unstructured};
7085 let mut buf = [0u8; 1024];
7086 rng.fill_bytes(&mut buf);
7087 let mut unstructured = Unstructured::new(&buf);
7088 Self::arbitrary(&mut unstructured).unwrap_or_default()
7089 }
7090}
7091impl Default for BUTTON_CHANGE_DATA {
7092 fn default() -> Self {
7093 Self::DEFAULT.clone()
7094 }
7095}
7096impl MessageData for BUTTON_CHANGE_DATA {
7097 type Message = MavMessage;
7098 const ID: u32 = 257u32;
7099 const NAME: &'static str = "BUTTON_CHANGE";
7100 const EXTRA_CRC: u8 = 131u8;
7101 const ENCODED_LEN: usize = 9usize;
7102 fn deser(
7103 _version: MavlinkVersion,
7104 __input: &[u8],
7105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7106 let avail_len = __input.len();
7107 let mut payload_buf = [0; Self::ENCODED_LEN];
7108 let mut buf = if avail_len < Self::ENCODED_LEN {
7109 payload_buf[0..avail_len].copy_from_slice(__input);
7110 Bytes::new(&payload_buf)
7111 } else {
7112 Bytes::new(__input)
7113 };
7114 let mut __struct = Self::default();
7115 __struct.time_boot_ms = buf.get_u32_le()?;
7116 __struct.last_change_ms = buf.get_u32_le()?;
7117 __struct.state = buf.get_u8()?;
7118 Ok(__struct)
7119 }
7120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7121 let mut __tmp = BytesMut::new(bytes);
7122 #[allow(clippy::absurd_extreme_comparisons)]
7123 #[allow(unused_comparisons)]
7124 if __tmp.remaining() < Self::ENCODED_LEN {
7125 panic!(
7126 "buffer is too small (need {} bytes, but got {})",
7127 Self::ENCODED_LEN,
7128 __tmp.remaining(),
7129 )
7130 }
7131 __tmp.put_u32_le(self.time_boot_ms);
7132 __tmp.put_u32_le(self.last_change_ms);
7133 __tmp.put_u8(self.state);
7134 if matches!(version, MavlinkVersion::V2) {
7135 let len = __tmp.len();
7136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7137 } else {
7138 __tmp.len()
7139 }
7140 }
7141}
7142#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7143#[doc = ""]
7144#[doc = "ID: 262"]
7145#[derive(Debug, Clone, PartialEq)]
7146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7148#[cfg_attr(feature = "ts", derive(TS))]
7149#[cfg_attr(feature = "ts", ts(export))]
7150pub struct CAMERA_CAPTURE_STATUS_DATA {
7151 #[doc = "Timestamp (time since system boot)."]
7152 pub time_boot_ms: u32,
7153 #[doc = "Image capture interval"]
7154 pub image_interval: f32,
7155 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7156 pub recording_time_ms: u32,
7157 #[doc = "Available storage capacity."]
7158 pub available_capacity: f32,
7159 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7160 pub image_status: u8,
7161 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7162 pub video_status: u8,
7163 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7165 pub image_count: i32,
7166 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7168 pub camera_device_id: u8,
7169}
7170impl CAMERA_CAPTURE_STATUS_DATA {
7171 pub const ENCODED_LEN: usize = 23usize;
7172 pub const DEFAULT: Self = Self {
7173 time_boot_ms: 0_u32,
7174 image_interval: 0.0_f32,
7175 recording_time_ms: 0_u32,
7176 available_capacity: 0.0_f32,
7177 image_status: 0_u8,
7178 video_status: 0_u8,
7179 image_count: 0_i32,
7180 camera_device_id: 0_u8,
7181 };
7182 #[cfg(feature = "arbitrary")]
7183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7184 use arbitrary::{Arbitrary, Unstructured};
7185 let mut buf = [0u8; 1024];
7186 rng.fill_bytes(&mut buf);
7187 let mut unstructured = Unstructured::new(&buf);
7188 Self::arbitrary(&mut unstructured).unwrap_or_default()
7189 }
7190}
7191impl Default for CAMERA_CAPTURE_STATUS_DATA {
7192 fn default() -> Self {
7193 Self::DEFAULT.clone()
7194 }
7195}
7196impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7197 type Message = MavMessage;
7198 const ID: u32 = 262u32;
7199 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7200 const EXTRA_CRC: u8 = 12u8;
7201 const ENCODED_LEN: usize = 23usize;
7202 fn deser(
7203 _version: MavlinkVersion,
7204 __input: &[u8],
7205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7206 let avail_len = __input.len();
7207 let mut payload_buf = [0; Self::ENCODED_LEN];
7208 let mut buf = if avail_len < Self::ENCODED_LEN {
7209 payload_buf[0..avail_len].copy_from_slice(__input);
7210 Bytes::new(&payload_buf)
7211 } else {
7212 Bytes::new(__input)
7213 };
7214 let mut __struct = Self::default();
7215 __struct.time_boot_ms = buf.get_u32_le()?;
7216 __struct.image_interval = buf.get_f32_le()?;
7217 __struct.recording_time_ms = buf.get_u32_le()?;
7218 __struct.available_capacity = buf.get_f32_le()?;
7219 __struct.image_status = buf.get_u8()?;
7220 __struct.video_status = buf.get_u8()?;
7221 __struct.image_count = buf.get_i32_le()?;
7222 __struct.camera_device_id = buf.get_u8()?;
7223 Ok(__struct)
7224 }
7225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7226 let mut __tmp = BytesMut::new(bytes);
7227 #[allow(clippy::absurd_extreme_comparisons)]
7228 #[allow(unused_comparisons)]
7229 if __tmp.remaining() < Self::ENCODED_LEN {
7230 panic!(
7231 "buffer is too small (need {} bytes, but got {})",
7232 Self::ENCODED_LEN,
7233 __tmp.remaining(),
7234 )
7235 }
7236 __tmp.put_u32_le(self.time_boot_ms);
7237 __tmp.put_f32_le(self.image_interval);
7238 __tmp.put_u32_le(self.recording_time_ms);
7239 __tmp.put_f32_le(self.available_capacity);
7240 __tmp.put_u8(self.image_status);
7241 __tmp.put_u8(self.video_status);
7242 if matches!(version, MavlinkVersion::V2) {
7243 __tmp.put_i32_le(self.image_count);
7244 __tmp.put_u8(self.camera_device_id);
7245 let len = __tmp.len();
7246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7247 } else {
7248 __tmp.len()
7249 }
7250 }
7251}
7252#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7253#[doc = ""]
7254#[doc = "ID: 271"]
7255#[derive(Debug, Clone, PartialEq)]
7256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7258#[cfg_attr(feature = "ts", derive(TS))]
7259#[cfg_attr(feature = "ts", ts(export))]
7260pub struct CAMERA_FOV_STATUS_DATA {
7261 #[doc = "Timestamp (time since system boot)."]
7262 pub time_boot_ms: u32,
7263 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7264 pub lat_camera: i32,
7265 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7266 pub lon_camera: i32,
7267 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7268 pub alt_camera: i32,
7269 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7270 pub lat_image: i32,
7271 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7272 pub lon_image: i32,
7273 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7274 pub alt_image: i32,
7275 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7277 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7278 pub q: [f32; 4],
7279 #[doc = "Horizontal field of view (NaN if unknown)."]
7280 pub hfov: f32,
7281 #[doc = "Vertical field of view (NaN if unknown)."]
7282 pub vfov: f32,
7283 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7284 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7285 pub camera_device_id: u8,
7286}
7287impl CAMERA_FOV_STATUS_DATA {
7288 pub const ENCODED_LEN: usize = 53usize;
7289 pub const DEFAULT: Self = Self {
7290 time_boot_ms: 0_u32,
7291 lat_camera: 0_i32,
7292 lon_camera: 0_i32,
7293 alt_camera: 0_i32,
7294 lat_image: 0_i32,
7295 lon_image: 0_i32,
7296 alt_image: 0_i32,
7297 q: [0.0_f32; 4usize],
7298 hfov: 0.0_f32,
7299 vfov: 0.0_f32,
7300 camera_device_id: 0_u8,
7301 };
7302 #[cfg(feature = "arbitrary")]
7303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7304 use arbitrary::{Arbitrary, Unstructured};
7305 let mut buf = [0u8; 1024];
7306 rng.fill_bytes(&mut buf);
7307 let mut unstructured = Unstructured::new(&buf);
7308 Self::arbitrary(&mut unstructured).unwrap_or_default()
7309 }
7310}
7311impl Default for CAMERA_FOV_STATUS_DATA {
7312 fn default() -> Self {
7313 Self::DEFAULT.clone()
7314 }
7315}
7316impl MessageData for CAMERA_FOV_STATUS_DATA {
7317 type Message = MavMessage;
7318 const ID: u32 = 271u32;
7319 const NAME: &'static str = "CAMERA_FOV_STATUS";
7320 const EXTRA_CRC: u8 = 22u8;
7321 const ENCODED_LEN: usize = 53usize;
7322 fn deser(
7323 _version: MavlinkVersion,
7324 __input: &[u8],
7325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7326 let avail_len = __input.len();
7327 let mut payload_buf = [0; Self::ENCODED_LEN];
7328 let mut buf = if avail_len < Self::ENCODED_LEN {
7329 payload_buf[0..avail_len].copy_from_slice(__input);
7330 Bytes::new(&payload_buf)
7331 } else {
7332 Bytes::new(__input)
7333 };
7334 let mut __struct = Self::default();
7335 __struct.time_boot_ms = buf.get_u32_le()?;
7336 __struct.lat_camera = buf.get_i32_le()?;
7337 __struct.lon_camera = buf.get_i32_le()?;
7338 __struct.alt_camera = buf.get_i32_le()?;
7339 __struct.lat_image = buf.get_i32_le()?;
7340 __struct.lon_image = buf.get_i32_le()?;
7341 __struct.alt_image = buf.get_i32_le()?;
7342 for v in &mut __struct.q {
7343 let val = buf.get_f32_le()?;
7344 *v = val;
7345 }
7346 __struct.hfov = buf.get_f32_le()?;
7347 __struct.vfov = buf.get_f32_le()?;
7348 __struct.camera_device_id = buf.get_u8()?;
7349 Ok(__struct)
7350 }
7351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7352 let mut __tmp = BytesMut::new(bytes);
7353 #[allow(clippy::absurd_extreme_comparisons)]
7354 #[allow(unused_comparisons)]
7355 if __tmp.remaining() < Self::ENCODED_LEN {
7356 panic!(
7357 "buffer is too small (need {} bytes, but got {})",
7358 Self::ENCODED_LEN,
7359 __tmp.remaining(),
7360 )
7361 }
7362 __tmp.put_u32_le(self.time_boot_ms);
7363 __tmp.put_i32_le(self.lat_camera);
7364 __tmp.put_i32_le(self.lon_camera);
7365 __tmp.put_i32_le(self.alt_camera);
7366 __tmp.put_i32_le(self.lat_image);
7367 __tmp.put_i32_le(self.lon_image);
7368 __tmp.put_i32_le(self.alt_image);
7369 for val in &self.q {
7370 __tmp.put_f32_le(*val);
7371 }
7372 __tmp.put_f32_le(self.hfov);
7373 __tmp.put_f32_le(self.vfov);
7374 if matches!(version, MavlinkVersion::V2) {
7375 __tmp.put_u8(self.camera_device_id);
7376 let len = __tmp.len();
7377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7378 } else {
7379 __tmp.len()
7380 }
7381 }
7382}
7383#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7384#[doc = ""]
7385#[doc = "ID: 263"]
7386#[derive(Debug, Clone, PartialEq)]
7387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7389#[cfg_attr(feature = "ts", derive(TS))]
7390#[cfg_attr(feature = "ts", ts(export))]
7391pub struct CAMERA_IMAGE_CAPTURED_DATA {
7392 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7393 pub time_utc: u64,
7394 #[doc = "Timestamp (time since system boot)."]
7395 pub time_boot_ms: u32,
7396 #[doc = "Latitude where image was taken"]
7397 pub lat: i32,
7398 #[doc = "Longitude where capture was taken"]
7399 pub lon: i32,
7400 #[doc = "Altitude (MSL) where image was taken"]
7401 pub alt: i32,
7402 #[doc = "Altitude above ground"]
7403 pub relative_alt: i32,
7404 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7406 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7407 pub q: [f32; 4],
7408 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7409 pub image_index: i32,
7410 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7411 pub camera_id: u8,
7412 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7413 pub capture_result: i8,
7414 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7415 #[cfg_attr(feature = "ts", ts(type = "string"))]
7416 pub file_url: CharArray<205>,
7417}
7418impl CAMERA_IMAGE_CAPTURED_DATA {
7419 pub const ENCODED_LEN: usize = 255usize;
7420 pub const DEFAULT: Self = Self {
7421 time_utc: 0_u64,
7422 time_boot_ms: 0_u32,
7423 lat: 0_i32,
7424 lon: 0_i32,
7425 alt: 0_i32,
7426 relative_alt: 0_i32,
7427 q: [0.0_f32; 4usize],
7428 image_index: 0_i32,
7429 camera_id: 0_u8,
7430 capture_result: 0_i8,
7431 file_url: CharArray::new([0_u8; 205usize]),
7432 };
7433 #[cfg(feature = "arbitrary")]
7434 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7435 use arbitrary::{Arbitrary, Unstructured};
7436 let mut buf = [0u8; 1024];
7437 rng.fill_bytes(&mut buf);
7438 let mut unstructured = Unstructured::new(&buf);
7439 Self::arbitrary(&mut unstructured).unwrap_or_default()
7440 }
7441}
7442impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7443 fn default() -> Self {
7444 Self::DEFAULT.clone()
7445 }
7446}
7447impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7448 type Message = MavMessage;
7449 const ID: u32 = 263u32;
7450 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7451 const EXTRA_CRC: u8 = 133u8;
7452 const ENCODED_LEN: usize = 255usize;
7453 fn deser(
7454 _version: MavlinkVersion,
7455 __input: &[u8],
7456 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7457 let avail_len = __input.len();
7458 let mut payload_buf = [0; Self::ENCODED_LEN];
7459 let mut buf = if avail_len < Self::ENCODED_LEN {
7460 payload_buf[0..avail_len].copy_from_slice(__input);
7461 Bytes::new(&payload_buf)
7462 } else {
7463 Bytes::new(__input)
7464 };
7465 let mut __struct = Self::default();
7466 __struct.time_utc = buf.get_u64_le()?;
7467 __struct.time_boot_ms = buf.get_u32_le()?;
7468 __struct.lat = buf.get_i32_le()?;
7469 __struct.lon = buf.get_i32_le()?;
7470 __struct.alt = buf.get_i32_le()?;
7471 __struct.relative_alt = buf.get_i32_le()?;
7472 for v in &mut __struct.q {
7473 let val = buf.get_f32_le()?;
7474 *v = val;
7475 }
7476 __struct.image_index = buf.get_i32_le()?;
7477 __struct.camera_id = buf.get_u8()?;
7478 __struct.capture_result = buf.get_i8()?;
7479 let mut tmp = [0_u8; 205usize];
7480 for v in &mut tmp {
7481 *v = buf.get_u8()?;
7482 }
7483 __struct.file_url = CharArray::new(tmp);
7484 Ok(__struct)
7485 }
7486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7487 let mut __tmp = BytesMut::new(bytes);
7488 #[allow(clippy::absurd_extreme_comparisons)]
7489 #[allow(unused_comparisons)]
7490 if __tmp.remaining() < Self::ENCODED_LEN {
7491 panic!(
7492 "buffer is too small (need {} bytes, but got {})",
7493 Self::ENCODED_LEN,
7494 __tmp.remaining(),
7495 )
7496 }
7497 __tmp.put_u64_le(self.time_utc);
7498 __tmp.put_u32_le(self.time_boot_ms);
7499 __tmp.put_i32_le(self.lat);
7500 __tmp.put_i32_le(self.lon);
7501 __tmp.put_i32_le(self.alt);
7502 __tmp.put_i32_le(self.relative_alt);
7503 for val in &self.q {
7504 __tmp.put_f32_le(*val);
7505 }
7506 __tmp.put_i32_le(self.image_index);
7507 __tmp.put_u8(self.camera_id);
7508 __tmp.put_i8(self.capture_result);
7509 for val in &self.file_url {
7510 __tmp.put_u8(*val);
7511 }
7512 if matches!(version, MavlinkVersion::V2) {
7513 let len = __tmp.len();
7514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7515 } else {
7516 __tmp.len()
7517 }
7518 }
7519}
7520#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7521#[doc = ""]
7522#[doc = "ID: 259"]
7523#[derive(Debug, Clone, PartialEq)]
7524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7526#[cfg_attr(feature = "ts", derive(TS))]
7527#[cfg_attr(feature = "ts", ts(export))]
7528pub struct CAMERA_INFORMATION_DATA {
7529 #[doc = "Timestamp (time since system boot)."]
7530 pub time_boot_ms: u32,
7531 #[doc = "Version of the camera firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff). Use 0 if not known."]
7532 pub firmware_version: u32,
7533 #[doc = "Focal length. Use NaN if not known."]
7534 pub focal_length: f32,
7535 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7536 pub sensor_size_h: f32,
7537 #[doc = "Image sensor size vertical. Use NaN if not known."]
7538 pub sensor_size_v: f32,
7539 #[doc = "Bitmap of camera capability flags."]
7540 pub flags: CameraCapFlags,
7541 #[doc = "Horizontal image resolution. Use 0 if not known."]
7542 pub resolution_h: u16,
7543 #[doc = "Vertical image resolution. Use 0 if not known."]
7544 pub resolution_v: u16,
7545 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7546 pub cam_definition_version: u16,
7547 #[doc = "Name of the camera vendor"]
7548 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7549 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7550 pub vendor_name: [u8; 32],
7551 #[doc = "Name of the camera model"]
7552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7553 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7554 pub model_name: [u8; 32],
7555 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7556 pub lens_id: u8,
7557 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7558 #[cfg_attr(feature = "ts", ts(type = "string"))]
7559 pub cam_definition_uri: CharArray<140>,
7560 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7561 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7562 pub gimbal_device_id: u8,
7563 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7564 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7565 pub camera_device_id: u8,
7566}
7567impl CAMERA_INFORMATION_DATA {
7568 pub const ENCODED_LEN: usize = 237usize;
7569 pub const DEFAULT: Self = Self {
7570 time_boot_ms: 0_u32,
7571 firmware_version: 0_u32,
7572 focal_length: 0.0_f32,
7573 sensor_size_h: 0.0_f32,
7574 sensor_size_v: 0.0_f32,
7575 flags: CameraCapFlags::DEFAULT,
7576 resolution_h: 0_u16,
7577 resolution_v: 0_u16,
7578 cam_definition_version: 0_u16,
7579 vendor_name: [0_u8; 32usize],
7580 model_name: [0_u8; 32usize],
7581 lens_id: 0_u8,
7582 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7583 gimbal_device_id: 0_u8,
7584 camera_device_id: 0_u8,
7585 };
7586 #[cfg(feature = "arbitrary")]
7587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7588 use arbitrary::{Arbitrary, Unstructured};
7589 let mut buf = [0u8; 1024];
7590 rng.fill_bytes(&mut buf);
7591 let mut unstructured = Unstructured::new(&buf);
7592 Self::arbitrary(&mut unstructured).unwrap_or_default()
7593 }
7594}
7595impl Default for CAMERA_INFORMATION_DATA {
7596 fn default() -> Self {
7597 Self::DEFAULT.clone()
7598 }
7599}
7600impl MessageData for CAMERA_INFORMATION_DATA {
7601 type Message = MavMessage;
7602 const ID: u32 = 259u32;
7603 const NAME: &'static str = "CAMERA_INFORMATION";
7604 const EXTRA_CRC: u8 = 92u8;
7605 const ENCODED_LEN: usize = 237usize;
7606 fn deser(
7607 _version: MavlinkVersion,
7608 __input: &[u8],
7609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7610 let avail_len = __input.len();
7611 let mut payload_buf = [0; Self::ENCODED_LEN];
7612 let mut buf = if avail_len < Self::ENCODED_LEN {
7613 payload_buf[0..avail_len].copy_from_slice(__input);
7614 Bytes::new(&payload_buf)
7615 } else {
7616 Bytes::new(__input)
7617 };
7618 let mut __struct = Self::default();
7619 __struct.time_boot_ms = buf.get_u32_le()?;
7620 __struct.firmware_version = buf.get_u32_le()?;
7621 __struct.focal_length = buf.get_f32_le()?;
7622 __struct.sensor_size_h = buf.get_f32_le()?;
7623 __struct.sensor_size_v = buf.get_f32_le()?;
7624 let tmp = buf.get_u32_le()?;
7625 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
7626 ::mavlink_core::error::ParserError::InvalidFlag {
7627 flag_type: "CameraCapFlags",
7628 value: tmp as u64,
7629 },
7630 )?;
7631 __struct.resolution_h = buf.get_u16_le()?;
7632 __struct.resolution_v = buf.get_u16_le()?;
7633 __struct.cam_definition_version = buf.get_u16_le()?;
7634 for v in &mut __struct.vendor_name {
7635 let val = buf.get_u8()?;
7636 *v = val;
7637 }
7638 for v in &mut __struct.model_name {
7639 let val = buf.get_u8()?;
7640 *v = val;
7641 }
7642 __struct.lens_id = buf.get_u8()?;
7643 let mut tmp = [0_u8; 140usize];
7644 for v in &mut tmp {
7645 *v = buf.get_u8()?;
7646 }
7647 __struct.cam_definition_uri = CharArray::new(tmp);
7648 __struct.gimbal_device_id = buf.get_u8()?;
7649 __struct.camera_device_id = buf.get_u8()?;
7650 Ok(__struct)
7651 }
7652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7653 let mut __tmp = BytesMut::new(bytes);
7654 #[allow(clippy::absurd_extreme_comparisons)]
7655 #[allow(unused_comparisons)]
7656 if __tmp.remaining() < Self::ENCODED_LEN {
7657 panic!(
7658 "buffer is too small (need {} bytes, but got {})",
7659 Self::ENCODED_LEN,
7660 __tmp.remaining(),
7661 )
7662 }
7663 __tmp.put_u32_le(self.time_boot_ms);
7664 __tmp.put_u32_le(self.firmware_version);
7665 __tmp.put_f32_le(self.focal_length);
7666 __tmp.put_f32_le(self.sensor_size_h);
7667 __tmp.put_f32_le(self.sensor_size_v);
7668 __tmp.put_u32_le(self.flags.bits() as u32);
7669 __tmp.put_u16_le(self.resolution_h);
7670 __tmp.put_u16_le(self.resolution_v);
7671 __tmp.put_u16_le(self.cam_definition_version);
7672 for val in &self.vendor_name {
7673 __tmp.put_u8(*val);
7674 }
7675 for val in &self.model_name {
7676 __tmp.put_u8(*val);
7677 }
7678 __tmp.put_u8(self.lens_id);
7679 for val in &self.cam_definition_uri {
7680 __tmp.put_u8(*val);
7681 }
7682 if matches!(version, MavlinkVersion::V2) {
7683 __tmp.put_u8(self.gimbal_device_id);
7684 __tmp.put_u8(self.camera_device_id);
7685 let len = __tmp.len();
7686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7687 } else {
7688 __tmp.len()
7689 }
7690 }
7691}
7692#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7693#[doc = ""]
7694#[doc = "ID: 260"]
7695#[derive(Debug, Clone, PartialEq)]
7696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7698#[cfg_attr(feature = "ts", derive(TS))]
7699#[cfg_attr(feature = "ts", ts(export))]
7700pub struct CAMERA_SETTINGS_DATA {
7701 #[doc = "Timestamp (time since system boot)."]
7702 pub time_boot_ms: u32,
7703 #[doc = "Camera mode"]
7704 pub mode_id: CameraMode,
7705 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7707 pub zoomLevel: f32,
7708 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7710 pub focusLevel: f32,
7711 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7712 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7713 pub camera_device_id: u8,
7714}
7715impl CAMERA_SETTINGS_DATA {
7716 pub const ENCODED_LEN: usize = 14usize;
7717 pub const DEFAULT: Self = Self {
7718 time_boot_ms: 0_u32,
7719 mode_id: CameraMode::DEFAULT,
7720 zoomLevel: 0.0_f32,
7721 focusLevel: 0.0_f32,
7722 camera_device_id: 0_u8,
7723 };
7724 #[cfg(feature = "arbitrary")]
7725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7726 use arbitrary::{Arbitrary, Unstructured};
7727 let mut buf = [0u8; 1024];
7728 rng.fill_bytes(&mut buf);
7729 let mut unstructured = Unstructured::new(&buf);
7730 Self::arbitrary(&mut unstructured).unwrap_or_default()
7731 }
7732}
7733impl Default for CAMERA_SETTINGS_DATA {
7734 fn default() -> Self {
7735 Self::DEFAULT.clone()
7736 }
7737}
7738impl MessageData for CAMERA_SETTINGS_DATA {
7739 type Message = MavMessage;
7740 const ID: u32 = 260u32;
7741 const NAME: &'static str = "CAMERA_SETTINGS";
7742 const EXTRA_CRC: u8 = 146u8;
7743 const ENCODED_LEN: usize = 14usize;
7744 fn deser(
7745 _version: MavlinkVersion,
7746 __input: &[u8],
7747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7748 let avail_len = __input.len();
7749 let mut payload_buf = [0; Self::ENCODED_LEN];
7750 let mut buf = if avail_len < Self::ENCODED_LEN {
7751 payload_buf[0..avail_len].copy_from_slice(__input);
7752 Bytes::new(&payload_buf)
7753 } else {
7754 Bytes::new(__input)
7755 };
7756 let mut __struct = Self::default();
7757 __struct.time_boot_ms = buf.get_u32_le()?;
7758 let tmp = buf.get_u8()?;
7759 __struct.mode_id =
7760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7761 enum_type: "CameraMode",
7762 value: tmp as u64,
7763 })?;
7764 __struct.zoomLevel = buf.get_f32_le()?;
7765 __struct.focusLevel = buf.get_f32_le()?;
7766 __struct.camera_device_id = buf.get_u8()?;
7767 Ok(__struct)
7768 }
7769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7770 let mut __tmp = BytesMut::new(bytes);
7771 #[allow(clippy::absurd_extreme_comparisons)]
7772 #[allow(unused_comparisons)]
7773 if __tmp.remaining() < Self::ENCODED_LEN {
7774 panic!(
7775 "buffer is too small (need {} bytes, but got {})",
7776 Self::ENCODED_LEN,
7777 __tmp.remaining(),
7778 )
7779 }
7780 __tmp.put_u32_le(self.time_boot_ms);
7781 __tmp.put_u8(self.mode_id as u8);
7782 if matches!(version, MavlinkVersion::V2) {
7783 __tmp.put_f32_le(self.zoomLevel);
7784 __tmp.put_f32_le(self.focusLevel);
7785 __tmp.put_u8(self.camera_device_id);
7786 let len = __tmp.len();
7787 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7788 } else {
7789 __tmp.len()
7790 }
7791 }
7792}
7793#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7794#[doc = ""]
7795#[doc = "ID: 277"]
7796#[derive(Debug, Clone, PartialEq)]
7797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7798#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7799#[cfg_attr(feature = "ts", derive(TS))]
7800#[cfg_attr(feature = "ts", ts(export))]
7801pub struct CAMERA_THERMAL_RANGE_DATA {
7802 #[doc = "Timestamp (time since system boot)."]
7803 pub time_boot_ms: u32,
7804 #[doc = "Temperature max."]
7805 pub max: f32,
7806 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7807 pub max_point_x: f32,
7808 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7809 pub max_point_y: f32,
7810 #[doc = "Temperature min."]
7811 pub min: f32,
7812 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7813 pub min_point_x: f32,
7814 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7815 pub min_point_y: f32,
7816 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7817 pub stream_id: u8,
7818 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7819 pub camera_device_id: u8,
7820}
7821impl CAMERA_THERMAL_RANGE_DATA {
7822 pub const ENCODED_LEN: usize = 30usize;
7823 pub const DEFAULT: Self = Self {
7824 time_boot_ms: 0_u32,
7825 max: 0.0_f32,
7826 max_point_x: 0.0_f32,
7827 max_point_y: 0.0_f32,
7828 min: 0.0_f32,
7829 min_point_x: 0.0_f32,
7830 min_point_y: 0.0_f32,
7831 stream_id: 0_u8,
7832 camera_device_id: 0_u8,
7833 };
7834 #[cfg(feature = "arbitrary")]
7835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7836 use arbitrary::{Arbitrary, Unstructured};
7837 let mut buf = [0u8; 1024];
7838 rng.fill_bytes(&mut buf);
7839 let mut unstructured = Unstructured::new(&buf);
7840 Self::arbitrary(&mut unstructured).unwrap_or_default()
7841 }
7842}
7843impl Default for CAMERA_THERMAL_RANGE_DATA {
7844 fn default() -> Self {
7845 Self::DEFAULT.clone()
7846 }
7847}
7848impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7849 type Message = MavMessage;
7850 const ID: u32 = 277u32;
7851 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7852 const EXTRA_CRC: u8 = 62u8;
7853 const ENCODED_LEN: usize = 30usize;
7854 fn deser(
7855 _version: MavlinkVersion,
7856 __input: &[u8],
7857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7858 let avail_len = __input.len();
7859 let mut payload_buf = [0; Self::ENCODED_LEN];
7860 let mut buf = if avail_len < Self::ENCODED_LEN {
7861 payload_buf[0..avail_len].copy_from_slice(__input);
7862 Bytes::new(&payload_buf)
7863 } else {
7864 Bytes::new(__input)
7865 };
7866 let mut __struct = Self::default();
7867 __struct.time_boot_ms = buf.get_u32_le()?;
7868 __struct.max = buf.get_f32_le()?;
7869 __struct.max_point_x = buf.get_f32_le()?;
7870 __struct.max_point_y = buf.get_f32_le()?;
7871 __struct.min = buf.get_f32_le()?;
7872 __struct.min_point_x = buf.get_f32_le()?;
7873 __struct.min_point_y = buf.get_f32_le()?;
7874 __struct.stream_id = buf.get_u8()?;
7875 __struct.camera_device_id = buf.get_u8()?;
7876 Ok(__struct)
7877 }
7878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7879 let mut __tmp = BytesMut::new(bytes);
7880 #[allow(clippy::absurd_extreme_comparisons)]
7881 #[allow(unused_comparisons)]
7882 if __tmp.remaining() < Self::ENCODED_LEN {
7883 panic!(
7884 "buffer is too small (need {} bytes, but got {})",
7885 Self::ENCODED_LEN,
7886 __tmp.remaining(),
7887 )
7888 }
7889 __tmp.put_u32_le(self.time_boot_ms);
7890 __tmp.put_f32_le(self.max);
7891 __tmp.put_f32_le(self.max_point_x);
7892 __tmp.put_f32_le(self.max_point_y);
7893 __tmp.put_f32_le(self.min);
7894 __tmp.put_f32_le(self.min_point_x);
7895 __tmp.put_f32_le(self.min_point_y);
7896 __tmp.put_u8(self.stream_id);
7897 __tmp.put_u8(self.camera_device_id);
7898 if matches!(version, MavlinkVersion::V2) {
7899 let len = __tmp.len();
7900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7901 } else {
7902 __tmp.len()
7903 }
7904 }
7905}
7906#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7907#[doc = ""]
7908#[doc = "ID: 276"]
7909#[derive(Debug, Clone, PartialEq)]
7910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7912#[cfg_attr(feature = "ts", derive(TS))]
7913#[cfg_attr(feature = "ts", ts(export))]
7914pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7915 #[doc = "Latitude of tracked object"]
7916 pub lat: i32,
7917 #[doc = "Longitude of tracked object"]
7918 pub lon: i32,
7919 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7920 pub alt: f32,
7921 #[doc = "Horizontal accuracy. NAN if unknown"]
7922 pub h_acc: f32,
7923 #[doc = "Vertical accuracy. NAN if unknown"]
7924 pub v_acc: f32,
7925 #[doc = "North velocity of tracked object. NAN if unknown"]
7926 pub vel_n: f32,
7927 #[doc = "East velocity of tracked object. NAN if unknown"]
7928 pub vel_e: f32,
7929 #[doc = "Down velocity of tracked object. NAN if unknown"]
7930 pub vel_d: f32,
7931 #[doc = "Velocity accuracy. NAN if unknown"]
7932 pub vel_acc: f32,
7933 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7934 pub dist: f32,
7935 #[doc = "Heading in radians, in NED. NAN if unknown"]
7936 pub hdg: f32,
7937 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7938 pub hdg_acc: f32,
7939 #[doc = "Current tracking status"]
7940 pub tracking_status: CameraTrackingStatusFlags,
7941 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7942 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7943 pub camera_device_id: u8,
7944}
7945impl CAMERA_TRACKING_GEO_STATUS_DATA {
7946 pub const ENCODED_LEN: usize = 50usize;
7947 pub const DEFAULT: Self = Self {
7948 lat: 0_i32,
7949 lon: 0_i32,
7950 alt: 0.0_f32,
7951 h_acc: 0.0_f32,
7952 v_acc: 0.0_f32,
7953 vel_n: 0.0_f32,
7954 vel_e: 0.0_f32,
7955 vel_d: 0.0_f32,
7956 vel_acc: 0.0_f32,
7957 dist: 0.0_f32,
7958 hdg: 0.0_f32,
7959 hdg_acc: 0.0_f32,
7960 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7961 camera_device_id: 0_u8,
7962 };
7963 #[cfg(feature = "arbitrary")]
7964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7965 use arbitrary::{Arbitrary, Unstructured};
7966 let mut buf = [0u8; 1024];
7967 rng.fill_bytes(&mut buf);
7968 let mut unstructured = Unstructured::new(&buf);
7969 Self::arbitrary(&mut unstructured).unwrap_or_default()
7970 }
7971}
7972impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7973 fn default() -> Self {
7974 Self::DEFAULT.clone()
7975 }
7976}
7977impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7978 type Message = MavMessage;
7979 const ID: u32 = 276u32;
7980 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7981 const EXTRA_CRC: u8 = 18u8;
7982 const ENCODED_LEN: usize = 50usize;
7983 fn deser(
7984 _version: MavlinkVersion,
7985 __input: &[u8],
7986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7987 let avail_len = __input.len();
7988 let mut payload_buf = [0; Self::ENCODED_LEN];
7989 let mut buf = if avail_len < Self::ENCODED_LEN {
7990 payload_buf[0..avail_len].copy_from_slice(__input);
7991 Bytes::new(&payload_buf)
7992 } else {
7993 Bytes::new(__input)
7994 };
7995 let mut __struct = Self::default();
7996 __struct.lat = buf.get_i32_le()?;
7997 __struct.lon = buf.get_i32_le()?;
7998 __struct.alt = buf.get_f32_le()?;
7999 __struct.h_acc = buf.get_f32_le()?;
8000 __struct.v_acc = buf.get_f32_le()?;
8001 __struct.vel_n = buf.get_f32_le()?;
8002 __struct.vel_e = buf.get_f32_le()?;
8003 __struct.vel_d = buf.get_f32_le()?;
8004 __struct.vel_acc = buf.get_f32_le()?;
8005 __struct.dist = buf.get_f32_le()?;
8006 __struct.hdg = buf.get_f32_le()?;
8007 __struct.hdg_acc = buf.get_f32_le()?;
8008 let tmp = buf.get_u8()?;
8009 __struct.tracking_status =
8010 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8011 enum_type: "CameraTrackingStatusFlags",
8012 value: tmp as u64,
8013 })?;
8014 __struct.camera_device_id = buf.get_u8()?;
8015 Ok(__struct)
8016 }
8017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8018 let mut __tmp = BytesMut::new(bytes);
8019 #[allow(clippy::absurd_extreme_comparisons)]
8020 #[allow(unused_comparisons)]
8021 if __tmp.remaining() < Self::ENCODED_LEN {
8022 panic!(
8023 "buffer is too small (need {} bytes, but got {})",
8024 Self::ENCODED_LEN,
8025 __tmp.remaining(),
8026 )
8027 }
8028 __tmp.put_i32_le(self.lat);
8029 __tmp.put_i32_le(self.lon);
8030 __tmp.put_f32_le(self.alt);
8031 __tmp.put_f32_le(self.h_acc);
8032 __tmp.put_f32_le(self.v_acc);
8033 __tmp.put_f32_le(self.vel_n);
8034 __tmp.put_f32_le(self.vel_e);
8035 __tmp.put_f32_le(self.vel_d);
8036 __tmp.put_f32_le(self.vel_acc);
8037 __tmp.put_f32_le(self.dist);
8038 __tmp.put_f32_le(self.hdg);
8039 __tmp.put_f32_le(self.hdg_acc);
8040 __tmp.put_u8(self.tracking_status as u8);
8041 if matches!(version, MavlinkVersion::V2) {
8042 __tmp.put_u8(self.camera_device_id);
8043 let len = __tmp.len();
8044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8045 } else {
8046 __tmp.len()
8047 }
8048 }
8049}
8050#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8051#[doc = ""]
8052#[doc = "ID: 275"]
8053#[derive(Debug, Clone, PartialEq)]
8054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8056#[cfg_attr(feature = "ts", derive(TS))]
8057#[cfg_attr(feature = "ts", ts(export))]
8058pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8059 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8060 pub point_x: f32,
8061 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8062 pub point_y: f32,
8063 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8064 pub radius: f32,
8065 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8066 pub rec_top_x: f32,
8067 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8068 pub rec_top_y: f32,
8069 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8070 pub rec_bottom_x: f32,
8071 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8072 pub rec_bottom_y: f32,
8073 #[doc = "Current tracking status"]
8074 pub tracking_status: CameraTrackingStatusFlags,
8075 #[doc = "Current tracking mode"]
8076 pub tracking_mode: CameraTrackingMode,
8077 #[doc = "Defines location of target data"]
8078 pub target_data: CameraTrackingTargetData,
8079 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8080 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8081 pub camera_device_id: u8,
8082}
8083impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8084 pub const ENCODED_LEN: usize = 32usize;
8085 pub const DEFAULT: Self = Self {
8086 point_x: 0.0_f32,
8087 point_y: 0.0_f32,
8088 radius: 0.0_f32,
8089 rec_top_x: 0.0_f32,
8090 rec_top_y: 0.0_f32,
8091 rec_bottom_x: 0.0_f32,
8092 rec_bottom_y: 0.0_f32,
8093 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8094 tracking_mode: CameraTrackingMode::DEFAULT,
8095 target_data: CameraTrackingTargetData::DEFAULT,
8096 camera_device_id: 0_u8,
8097 };
8098 #[cfg(feature = "arbitrary")]
8099 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8100 use arbitrary::{Arbitrary, Unstructured};
8101 let mut buf = [0u8; 1024];
8102 rng.fill_bytes(&mut buf);
8103 let mut unstructured = Unstructured::new(&buf);
8104 Self::arbitrary(&mut unstructured).unwrap_or_default()
8105 }
8106}
8107impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8108 fn default() -> Self {
8109 Self::DEFAULT.clone()
8110 }
8111}
8112impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8113 type Message = MavMessage;
8114 const ID: u32 = 275u32;
8115 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8116 const EXTRA_CRC: u8 = 126u8;
8117 const ENCODED_LEN: usize = 32usize;
8118 fn deser(
8119 _version: MavlinkVersion,
8120 __input: &[u8],
8121 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8122 let avail_len = __input.len();
8123 let mut payload_buf = [0; Self::ENCODED_LEN];
8124 let mut buf = if avail_len < Self::ENCODED_LEN {
8125 payload_buf[0..avail_len].copy_from_slice(__input);
8126 Bytes::new(&payload_buf)
8127 } else {
8128 Bytes::new(__input)
8129 };
8130 let mut __struct = Self::default();
8131 __struct.point_x = buf.get_f32_le()?;
8132 __struct.point_y = buf.get_f32_le()?;
8133 __struct.radius = buf.get_f32_le()?;
8134 __struct.rec_top_x = buf.get_f32_le()?;
8135 __struct.rec_top_y = buf.get_f32_le()?;
8136 __struct.rec_bottom_x = buf.get_f32_le()?;
8137 __struct.rec_bottom_y = buf.get_f32_le()?;
8138 let tmp = buf.get_u8()?;
8139 __struct.tracking_status =
8140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8141 enum_type: "CameraTrackingStatusFlags",
8142 value: tmp as u64,
8143 })?;
8144 let tmp = buf.get_u8()?;
8145 __struct.tracking_mode =
8146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8147 enum_type: "CameraTrackingMode",
8148 value: tmp as u64,
8149 })?;
8150 let tmp = buf.get_u8()?;
8151 __struct.target_data =
8152 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
8153 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8154 flag_type: "CameraTrackingTargetData",
8155 value: tmp as u64,
8156 })?;
8157 __struct.camera_device_id = buf.get_u8()?;
8158 Ok(__struct)
8159 }
8160 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8161 let mut __tmp = BytesMut::new(bytes);
8162 #[allow(clippy::absurd_extreme_comparisons)]
8163 #[allow(unused_comparisons)]
8164 if __tmp.remaining() < Self::ENCODED_LEN {
8165 panic!(
8166 "buffer is too small (need {} bytes, but got {})",
8167 Self::ENCODED_LEN,
8168 __tmp.remaining(),
8169 )
8170 }
8171 __tmp.put_f32_le(self.point_x);
8172 __tmp.put_f32_le(self.point_y);
8173 __tmp.put_f32_le(self.radius);
8174 __tmp.put_f32_le(self.rec_top_x);
8175 __tmp.put_f32_le(self.rec_top_y);
8176 __tmp.put_f32_le(self.rec_bottom_x);
8177 __tmp.put_f32_le(self.rec_bottom_y);
8178 __tmp.put_u8(self.tracking_status as u8);
8179 __tmp.put_u8(self.tracking_mode as u8);
8180 __tmp.put_u8(self.target_data.bits() as u8);
8181 if matches!(version, MavlinkVersion::V2) {
8182 __tmp.put_u8(self.camera_device_id);
8183 let len = __tmp.len();
8184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8185 } else {
8186 __tmp.len()
8187 }
8188 }
8189}
8190#[doc = "Camera-IMU triggering and synchronisation message."]
8191#[doc = ""]
8192#[doc = "ID: 112"]
8193#[derive(Debug, Clone, PartialEq)]
8194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8196#[cfg_attr(feature = "ts", derive(TS))]
8197#[cfg_attr(feature = "ts", ts(export))]
8198pub struct CAMERA_TRIGGER_DATA {
8199 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8200 pub time_usec: u64,
8201 #[doc = "Image frame sequence"]
8202 pub seq: u32,
8203}
8204impl CAMERA_TRIGGER_DATA {
8205 pub const ENCODED_LEN: usize = 12usize;
8206 pub const DEFAULT: Self = Self {
8207 time_usec: 0_u64,
8208 seq: 0_u32,
8209 };
8210 #[cfg(feature = "arbitrary")]
8211 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8212 use arbitrary::{Arbitrary, Unstructured};
8213 let mut buf = [0u8; 1024];
8214 rng.fill_bytes(&mut buf);
8215 let mut unstructured = Unstructured::new(&buf);
8216 Self::arbitrary(&mut unstructured).unwrap_or_default()
8217 }
8218}
8219impl Default for CAMERA_TRIGGER_DATA {
8220 fn default() -> Self {
8221 Self::DEFAULT.clone()
8222 }
8223}
8224impl MessageData for CAMERA_TRIGGER_DATA {
8225 type Message = MavMessage;
8226 const ID: u32 = 112u32;
8227 const NAME: &'static str = "CAMERA_TRIGGER";
8228 const EXTRA_CRC: u8 = 174u8;
8229 const ENCODED_LEN: usize = 12usize;
8230 fn deser(
8231 _version: MavlinkVersion,
8232 __input: &[u8],
8233 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8234 let avail_len = __input.len();
8235 let mut payload_buf = [0; Self::ENCODED_LEN];
8236 let mut buf = if avail_len < Self::ENCODED_LEN {
8237 payload_buf[0..avail_len].copy_from_slice(__input);
8238 Bytes::new(&payload_buf)
8239 } else {
8240 Bytes::new(__input)
8241 };
8242 let mut __struct = Self::default();
8243 __struct.time_usec = buf.get_u64_le()?;
8244 __struct.seq = buf.get_u32_le()?;
8245 Ok(__struct)
8246 }
8247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8248 let mut __tmp = BytesMut::new(bytes);
8249 #[allow(clippy::absurd_extreme_comparisons)]
8250 #[allow(unused_comparisons)]
8251 if __tmp.remaining() < Self::ENCODED_LEN {
8252 panic!(
8253 "buffer is too small (need {} bytes, but got {})",
8254 Self::ENCODED_LEN,
8255 __tmp.remaining(),
8256 )
8257 }
8258 __tmp.put_u64_le(self.time_usec);
8259 __tmp.put_u32_le(self.seq);
8260 if matches!(version, MavlinkVersion::V2) {
8261 let len = __tmp.len();
8262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8263 } else {
8264 __tmp.len()
8265 }
8266 }
8267}
8268#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8269#[doc = ""]
8270#[doc = "ID: 387"]
8271#[derive(Debug, Clone, PartialEq)]
8272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8274#[cfg_attr(feature = "ts", derive(TS))]
8275#[cfg_attr(feature = "ts", ts(export))]
8276pub struct CANFD_FRAME_DATA {
8277 #[doc = "Frame ID"]
8278 pub id: u32,
8279 #[doc = "System ID."]
8280 pub target_system: u8,
8281 #[doc = "Component ID."]
8282 pub target_component: u8,
8283 #[doc = "bus number"]
8284 pub bus: u8,
8285 #[doc = "Frame length"]
8286 pub len: u8,
8287 #[doc = "Frame data"]
8288 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8289 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8290 pub data: [u8; 64],
8291}
8292impl CANFD_FRAME_DATA {
8293 pub const ENCODED_LEN: usize = 72usize;
8294 pub const DEFAULT: Self = Self {
8295 id: 0_u32,
8296 target_system: 0_u8,
8297 target_component: 0_u8,
8298 bus: 0_u8,
8299 len: 0_u8,
8300 data: [0_u8; 64usize],
8301 };
8302 #[cfg(feature = "arbitrary")]
8303 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8304 use arbitrary::{Arbitrary, Unstructured};
8305 let mut buf = [0u8; 1024];
8306 rng.fill_bytes(&mut buf);
8307 let mut unstructured = Unstructured::new(&buf);
8308 Self::arbitrary(&mut unstructured).unwrap_or_default()
8309 }
8310}
8311impl Default for CANFD_FRAME_DATA {
8312 fn default() -> Self {
8313 Self::DEFAULT.clone()
8314 }
8315}
8316impl MessageData for CANFD_FRAME_DATA {
8317 type Message = MavMessage;
8318 const ID: u32 = 387u32;
8319 const NAME: &'static str = "CANFD_FRAME";
8320 const EXTRA_CRC: u8 = 4u8;
8321 const ENCODED_LEN: usize = 72usize;
8322 fn deser(
8323 _version: MavlinkVersion,
8324 __input: &[u8],
8325 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8326 let avail_len = __input.len();
8327 let mut payload_buf = [0; Self::ENCODED_LEN];
8328 let mut buf = if avail_len < Self::ENCODED_LEN {
8329 payload_buf[0..avail_len].copy_from_slice(__input);
8330 Bytes::new(&payload_buf)
8331 } else {
8332 Bytes::new(__input)
8333 };
8334 let mut __struct = Self::default();
8335 __struct.id = buf.get_u32_le()?;
8336 __struct.target_system = buf.get_u8()?;
8337 __struct.target_component = buf.get_u8()?;
8338 __struct.bus = buf.get_u8()?;
8339 __struct.len = buf.get_u8()?;
8340 for v in &mut __struct.data {
8341 let val = buf.get_u8()?;
8342 *v = val;
8343 }
8344 Ok(__struct)
8345 }
8346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8347 let mut __tmp = BytesMut::new(bytes);
8348 #[allow(clippy::absurd_extreme_comparisons)]
8349 #[allow(unused_comparisons)]
8350 if __tmp.remaining() < Self::ENCODED_LEN {
8351 panic!(
8352 "buffer is too small (need {} bytes, but got {})",
8353 Self::ENCODED_LEN,
8354 __tmp.remaining(),
8355 )
8356 }
8357 __tmp.put_u32_le(self.id);
8358 __tmp.put_u8(self.target_system);
8359 __tmp.put_u8(self.target_component);
8360 __tmp.put_u8(self.bus);
8361 __tmp.put_u8(self.len);
8362 for val in &self.data {
8363 __tmp.put_u8(*val);
8364 }
8365 if matches!(version, MavlinkVersion::V2) {
8366 let len = __tmp.len();
8367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8368 } else {
8369 __tmp.len()
8370 }
8371 }
8372}
8373#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8374#[doc = ""]
8375#[doc = "ID: 388"]
8376#[derive(Debug, Clone, PartialEq)]
8377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8379#[cfg_attr(feature = "ts", derive(TS))]
8380#[cfg_attr(feature = "ts", ts(export))]
8381pub struct CAN_FILTER_MODIFY_DATA {
8382 #[doc = "filter IDs, length num_ids"]
8383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8384 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8385 pub ids: [u16; 16],
8386 #[doc = "System ID."]
8387 pub target_system: u8,
8388 #[doc = "Component ID."]
8389 pub target_component: u8,
8390 #[doc = "bus number"]
8391 pub bus: u8,
8392 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8393 pub operation: CanFilterOp,
8394 #[doc = "number of IDs in filter list"]
8395 pub num_ids: u8,
8396}
8397impl CAN_FILTER_MODIFY_DATA {
8398 pub const ENCODED_LEN: usize = 37usize;
8399 pub const DEFAULT: Self = Self {
8400 ids: [0_u16; 16usize],
8401 target_system: 0_u8,
8402 target_component: 0_u8,
8403 bus: 0_u8,
8404 operation: CanFilterOp::DEFAULT,
8405 num_ids: 0_u8,
8406 };
8407 #[cfg(feature = "arbitrary")]
8408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8409 use arbitrary::{Arbitrary, Unstructured};
8410 let mut buf = [0u8; 1024];
8411 rng.fill_bytes(&mut buf);
8412 let mut unstructured = Unstructured::new(&buf);
8413 Self::arbitrary(&mut unstructured).unwrap_or_default()
8414 }
8415}
8416impl Default for CAN_FILTER_MODIFY_DATA {
8417 fn default() -> Self {
8418 Self::DEFAULT.clone()
8419 }
8420}
8421impl MessageData for CAN_FILTER_MODIFY_DATA {
8422 type Message = MavMessage;
8423 const ID: u32 = 388u32;
8424 const NAME: &'static str = "CAN_FILTER_MODIFY";
8425 const EXTRA_CRC: u8 = 8u8;
8426 const ENCODED_LEN: usize = 37usize;
8427 fn deser(
8428 _version: MavlinkVersion,
8429 __input: &[u8],
8430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8431 let avail_len = __input.len();
8432 let mut payload_buf = [0; Self::ENCODED_LEN];
8433 let mut buf = if avail_len < Self::ENCODED_LEN {
8434 payload_buf[0..avail_len].copy_from_slice(__input);
8435 Bytes::new(&payload_buf)
8436 } else {
8437 Bytes::new(__input)
8438 };
8439 let mut __struct = Self::default();
8440 for v in &mut __struct.ids {
8441 let val = buf.get_u16_le()?;
8442 *v = val;
8443 }
8444 __struct.target_system = buf.get_u8()?;
8445 __struct.target_component = buf.get_u8()?;
8446 __struct.bus = buf.get_u8()?;
8447 let tmp = buf.get_u8()?;
8448 __struct.operation =
8449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8450 enum_type: "CanFilterOp",
8451 value: tmp as u64,
8452 })?;
8453 __struct.num_ids = buf.get_u8()?;
8454 Ok(__struct)
8455 }
8456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8457 let mut __tmp = BytesMut::new(bytes);
8458 #[allow(clippy::absurd_extreme_comparisons)]
8459 #[allow(unused_comparisons)]
8460 if __tmp.remaining() < Self::ENCODED_LEN {
8461 panic!(
8462 "buffer is too small (need {} bytes, but got {})",
8463 Self::ENCODED_LEN,
8464 __tmp.remaining(),
8465 )
8466 }
8467 for val in &self.ids {
8468 __tmp.put_u16_le(*val);
8469 }
8470 __tmp.put_u8(self.target_system);
8471 __tmp.put_u8(self.target_component);
8472 __tmp.put_u8(self.bus);
8473 __tmp.put_u8(self.operation as u8);
8474 __tmp.put_u8(self.num_ids);
8475 if matches!(version, MavlinkVersion::V2) {
8476 let len = __tmp.len();
8477 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8478 } else {
8479 __tmp.len()
8480 }
8481 }
8482}
8483#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8484#[doc = ""]
8485#[doc = "ID: 386"]
8486#[derive(Debug, Clone, PartialEq)]
8487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8489#[cfg_attr(feature = "ts", derive(TS))]
8490#[cfg_attr(feature = "ts", ts(export))]
8491pub struct CAN_FRAME_DATA {
8492 #[doc = "Frame ID"]
8493 pub id: u32,
8494 #[doc = "System ID."]
8495 pub target_system: u8,
8496 #[doc = "Component ID."]
8497 pub target_component: u8,
8498 #[doc = "Bus number"]
8499 pub bus: u8,
8500 #[doc = "Frame length"]
8501 pub len: u8,
8502 #[doc = "Frame data"]
8503 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8504 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8505 pub data: [u8; 8],
8506}
8507impl CAN_FRAME_DATA {
8508 pub const ENCODED_LEN: usize = 16usize;
8509 pub const DEFAULT: Self = Self {
8510 id: 0_u32,
8511 target_system: 0_u8,
8512 target_component: 0_u8,
8513 bus: 0_u8,
8514 len: 0_u8,
8515 data: [0_u8; 8usize],
8516 };
8517 #[cfg(feature = "arbitrary")]
8518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8519 use arbitrary::{Arbitrary, Unstructured};
8520 let mut buf = [0u8; 1024];
8521 rng.fill_bytes(&mut buf);
8522 let mut unstructured = Unstructured::new(&buf);
8523 Self::arbitrary(&mut unstructured).unwrap_or_default()
8524 }
8525}
8526impl Default for CAN_FRAME_DATA {
8527 fn default() -> Self {
8528 Self::DEFAULT.clone()
8529 }
8530}
8531impl MessageData for CAN_FRAME_DATA {
8532 type Message = MavMessage;
8533 const ID: u32 = 386u32;
8534 const NAME: &'static str = "CAN_FRAME";
8535 const EXTRA_CRC: u8 = 132u8;
8536 const ENCODED_LEN: usize = 16usize;
8537 fn deser(
8538 _version: MavlinkVersion,
8539 __input: &[u8],
8540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8541 let avail_len = __input.len();
8542 let mut payload_buf = [0; Self::ENCODED_LEN];
8543 let mut buf = if avail_len < Self::ENCODED_LEN {
8544 payload_buf[0..avail_len].copy_from_slice(__input);
8545 Bytes::new(&payload_buf)
8546 } else {
8547 Bytes::new(__input)
8548 };
8549 let mut __struct = Self::default();
8550 __struct.id = buf.get_u32_le()?;
8551 __struct.target_system = buf.get_u8()?;
8552 __struct.target_component = buf.get_u8()?;
8553 __struct.bus = buf.get_u8()?;
8554 __struct.len = buf.get_u8()?;
8555 for v in &mut __struct.data {
8556 let val = buf.get_u8()?;
8557 *v = val;
8558 }
8559 Ok(__struct)
8560 }
8561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8562 let mut __tmp = BytesMut::new(bytes);
8563 #[allow(clippy::absurd_extreme_comparisons)]
8564 #[allow(unused_comparisons)]
8565 if __tmp.remaining() < Self::ENCODED_LEN {
8566 panic!(
8567 "buffer is too small (need {} bytes, but got {})",
8568 Self::ENCODED_LEN,
8569 __tmp.remaining(),
8570 )
8571 }
8572 __tmp.put_u32_le(self.id);
8573 __tmp.put_u8(self.target_system);
8574 __tmp.put_u8(self.target_component);
8575 __tmp.put_u8(self.bus);
8576 __tmp.put_u8(self.len);
8577 for val in &self.data {
8578 __tmp.put_u8(*val);
8579 }
8580 if matches!(version, MavlinkVersion::V2) {
8581 let len = __tmp.len();
8582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8583 } else {
8584 __tmp.len()
8585 }
8586 }
8587}
8588#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8589#[doc = ""]
8590#[doc = "ID: 336"]
8591#[derive(Debug, Clone, PartialEq)]
8592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8594#[cfg_attr(feature = "ts", derive(TS))]
8595#[cfg_attr(feature = "ts", ts(export))]
8596pub struct CELLULAR_CONFIG_DATA {
8597 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8598 pub enable_lte: u8,
8599 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8600 pub enable_pin: u8,
8601 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8602 #[cfg_attr(feature = "ts", ts(type = "string"))]
8603 pub pin: CharArray<16>,
8604 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8605 #[cfg_attr(feature = "ts", ts(type = "string"))]
8606 pub new_pin: CharArray<16>,
8607 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8608 #[cfg_attr(feature = "ts", ts(type = "string"))]
8609 pub apn: CharArray<32>,
8610 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8611 #[cfg_attr(feature = "ts", ts(type = "string"))]
8612 pub puk: CharArray<16>,
8613 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8614 pub roaming: u8,
8615 #[doc = "Message acceptance response (sent back to GS)."]
8616 pub response: CellularConfigResponse,
8617}
8618impl CELLULAR_CONFIG_DATA {
8619 pub const ENCODED_LEN: usize = 84usize;
8620 pub const DEFAULT: Self = Self {
8621 enable_lte: 0_u8,
8622 enable_pin: 0_u8,
8623 pin: CharArray::new([0_u8; 16usize]),
8624 new_pin: CharArray::new([0_u8; 16usize]),
8625 apn: CharArray::new([0_u8; 32usize]),
8626 puk: CharArray::new([0_u8; 16usize]),
8627 roaming: 0_u8,
8628 response: CellularConfigResponse::DEFAULT,
8629 };
8630 #[cfg(feature = "arbitrary")]
8631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8632 use arbitrary::{Arbitrary, Unstructured};
8633 let mut buf = [0u8; 1024];
8634 rng.fill_bytes(&mut buf);
8635 let mut unstructured = Unstructured::new(&buf);
8636 Self::arbitrary(&mut unstructured).unwrap_or_default()
8637 }
8638}
8639impl Default for CELLULAR_CONFIG_DATA {
8640 fn default() -> Self {
8641 Self::DEFAULT.clone()
8642 }
8643}
8644impl MessageData for CELLULAR_CONFIG_DATA {
8645 type Message = MavMessage;
8646 const ID: u32 = 336u32;
8647 const NAME: &'static str = "CELLULAR_CONFIG";
8648 const EXTRA_CRC: u8 = 245u8;
8649 const ENCODED_LEN: usize = 84usize;
8650 fn deser(
8651 _version: MavlinkVersion,
8652 __input: &[u8],
8653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8654 let avail_len = __input.len();
8655 let mut payload_buf = [0; Self::ENCODED_LEN];
8656 let mut buf = if avail_len < Self::ENCODED_LEN {
8657 payload_buf[0..avail_len].copy_from_slice(__input);
8658 Bytes::new(&payload_buf)
8659 } else {
8660 Bytes::new(__input)
8661 };
8662 let mut __struct = Self::default();
8663 __struct.enable_lte = buf.get_u8()?;
8664 __struct.enable_pin = buf.get_u8()?;
8665 let mut tmp = [0_u8; 16usize];
8666 for v in &mut tmp {
8667 *v = buf.get_u8()?;
8668 }
8669 __struct.pin = CharArray::new(tmp);
8670 let mut tmp = [0_u8; 16usize];
8671 for v in &mut tmp {
8672 *v = buf.get_u8()?;
8673 }
8674 __struct.new_pin = CharArray::new(tmp);
8675 let mut tmp = [0_u8; 32usize];
8676 for v in &mut tmp {
8677 *v = buf.get_u8()?;
8678 }
8679 __struct.apn = CharArray::new(tmp);
8680 let mut tmp = [0_u8; 16usize];
8681 for v in &mut tmp {
8682 *v = buf.get_u8()?;
8683 }
8684 __struct.puk = CharArray::new(tmp);
8685 __struct.roaming = buf.get_u8()?;
8686 let tmp = buf.get_u8()?;
8687 __struct.response =
8688 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8689 enum_type: "CellularConfigResponse",
8690 value: tmp as u64,
8691 })?;
8692 Ok(__struct)
8693 }
8694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8695 let mut __tmp = BytesMut::new(bytes);
8696 #[allow(clippy::absurd_extreme_comparisons)]
8697 #[allow(unused_comparisons)]
8698 if __tmp.remaining() < Self::ENCODED_LEN {
8699 panic!(
8700 "buffer is too small (need {} bytes, but got {})",
8701 Self::ENCODED_LEN,
8702 __tmp.remaining(),
8703 )
8704 }
8705 __tmp.put_u8(self.enable_lte);
8706 __tmp.put_u8(self.enable_pin);
8707 for val in &self.pin {
8708 __tmp.put_u8(*val);
8709 }
8710 for val in &self.new_pin {
8711 __tmp.put_u8(*val);
8712 }
8713 for val in &self.apn {
8714 __tmp.put_u8(*val);
8715 }
8716 for val in &self.puk {
8717 __tmp.put_u8(*val);
8718 }
8719 __tmp.put_u8(self.roaming);
8720 __tmp.put_u8(self.response as u8);
8721 if matches!(version, MavlinkVersion::V2) {
8722 let len = __tmp.len();
8723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8724 } else {
8725 __tmp.len()
8726 }
8727 }
8728}
8729#[doc = "Report current used cellular network status."]
8730#[doc = ""]
8731#[doc = "ID: 334"]
8732#[derive(Debug, Clone, PartialEq)]
8733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8735#[cfg_attr(feature = "ts", derive(TS))]
8736#[cfg_attr(feature = "ts", ts(export))]
8737pub struct CELLULAR_STATUS_DATA {
8738 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8739 pub mcc: u16,
8740 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8741 pub mnc: u16,
8742 #[doc = "Location area code. If unknown, set to 0"]
8743 pub lac: u16,
8744 #[doc = "Cellular modem status"]
8745 pub status: CellularStatusFlag,
8746 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8747 pub failure_reason: CellularNetworkFailedReason,
8748 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8749 pub mavtype: CellularNetworkRadioType,
8750 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8751 pub quality: u8,
8752}
8753impl CELLULAR_STATUS_DATA {
8754 pub const ENCODED_LEN: usize = 10usize;
8755 pub const DEFAULT: Self = Self {
8756 mcc: 0_u16,
8757 mnc: 0_u16,
8758 lac: 0_u16,
8759 status: CellularStatusFlag::DEFAULT,
8760 failure_reason: CellularNetworkFailedReason::DEFAULT,
8761 mavtype: CellularNetworkRadioType::DEFAULT,
8762 quality: 0_u8,
8763 };
8764 #[cfg(feature = "arbitrary")]
8765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8766 use arbitrary::{Arbitrary, Unstructured};
8767 let mut buf = [0u8; 1024];
8768 rng.fill_bytes(&mut buf);
8769 let mut unstructured = Unstructured::new(&buf);
8770 Self::arbitrary(&mut unstructured).unwrap_or_default()
8771 }
8772}
8773impl Default for CELLULAR_STATUS_DATA {
8774 fn default() -> Self {
8775 Self::DEFAULT.clone()
8776 }
8777}
8778impl MessageData for CELLULAR_STATUS_DATA {
8779 type Message = MavMessage;
8780 const ID: u32 = 334u32;
8781 const NAME: &'static str = "CELLULAR_STATUS";
8782 const EXTRA_CRC: u8 = 72u8;
8783 const ENCODED_LEN: usize = 10usize;
8784 fn deser(
8785 _version: MavlinkVersion,
8786 __input: &[u8],
8787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8788 let avail_len = __input.len();
8789 let mut payload_buf = [0; Self::ENCODED_LEN];
8790 let mut buf = if avail_len < Self::ENCODED_LEN {
8791 payload_buf[0..avail_len].copy_from_slice(__input);
8792 Bytes::new(&payload_buf)
8793 } else {
8794 Bytes::new(__input)
8795 };
8796 let mut __struct = Self::default();
8797 __struct.mcc = buf.get_u16_le()?;
8798 __struct.mnc = buf.get_u16_le()?;
8799 __struct.lac = buf.get_u16_le()?;
8800 let tmp = buf.get_u8()?;
8801 __struct.status =
8802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8803 enum_type: "CellularStatusFlag",
8804 value: tmp as u64,
8805 })?;
8806 let tmp = buf.get_u8()?;
8807 __struct.failure_reason =
8808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8809 enum_type: "CellularNetworkFailedReason",
8810 value: tmp as u64,
8811 })?;
8812 let tmp = buf.get_u8()?;
8813 __struct.mavtype =
8814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8815 enum_type: "CellularNetworkRadioType",
8816 value: tmp as u64,
8817 })?;
8818 __struct.quality = buf.get_u8()?;
8819 Ok(__struct)
8820 }
8821 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8822 let mut __tmp = BytesMut::new(bytes);
8823 #[allow(clippy::absurd_extreme_comparisons)]
8824 #[allow(unused_comparisons)]
8825 if __tmp.remaining() < Self::ENCODED_LEN {
8826 panic!(
8827 "buffer is too small (need {} bytes, but got {})",
8828 Self::ENCODED_LEN,
8829 __tmp.remaining(),
8830 )
8831 }
8832 __tmp.put_u16_le(self.mcc);
8833 __tmp.put_u16_le(self.mnc);
8834 __tmp.put_u16_le(self.lac);
8835 __tmp.put_u8(self.status as u8);
8836 __tmp.put_u8(self.failure_reason as u8);
8837 __tmp.put_u8(self.mavtype as u8);
8838 __tmp.put_u8(self.quality);
8839 if matches!(version, MavlinkVersion::V2) {
8840 let len = __tmp.len();
8841 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8842 } else {
8843 __tmp.len()
8844 }
8845 }
8846}
8847#[doc = "Request to control this MAV."]
8848#[doc = ""]
8849#[doc = "ID: 5"]
8850#[derive(Debug, Clone, PartialEq)]
8851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8853#[cfg_attr(feature = "ts", derive(TS))]
8854#[cfg_attr(feature = "ts", ts(export))]
8855pub struct CHANGE_OPERATOR_CONTROL_DATA {
8856 #[doc = "System the GCS requests control for"]
8857 pub target_system: u8,
8858 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8859 pub control_request: u8,
8860 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8861 pub version: u8,
8862 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8863 #[cfg_attr(feature = "ts", ts(type = "string"))]
8864 pub passkey: CharArray<25>,
8865}
8866impl CHANGE_OPERATOR_CONTROL_DATA {
8867 pub const ENCODED_LEN: usize = 28usize;
8868 pub const DEFAULT: Self = Self {
8869 target_system: 0_u8,
8870 control_request: 0_u8,
8871 version: 0_u8,
8872 passkey: CharArray::new([0_u8; 25usize]),
8873 };
8874 #[cfg(feature = "arbitrary")]
8875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8876 use arbitrary::{Arbitrary, Unstructured};
8877 let mut buf = [0u8; 1024];
8878 rng.fill_bytes(&mut buf);
8879 let mut unstructured = Unstructured::new(&buf);
8880 Self::arbitrary(&mut unstructured).unwrap_or_default()
8881 }
8882}
8883impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8884 fn default() -> Self {
8885 Self::DEFAULT.clone()
8886 }
8887}
8888impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8889 type Message = MavMessage;
8890 const ID: u32 = 5u32;
8891 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8892 const EXTRA_CRC: u8 = 217u8;
8893 const ENCODED_LEN: usize = 28usize;
8894 fn deser(
8895 _version: MavlinkVersion,
8896 __input: &[u8],
8897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8898 let avail_len = __input.len();
8899 let mut payload_buf = [0; Self::ENCODED_LEN];
8900 let mut buf = if avail_len < Self::ENCODED_LEN {
8901 payload_buf[0..avail_len].copy_from_slice(__input);
8902 Bytes::new(&payload_buf)
8903 } else {
8904 Bytes::new(__input)
8905 };
8906 let mut __struct = Self::default();
8907 __struct.target_system = buf.get_u8()?;
8908 __struct.control_request = buf.get_u8()?;
8909 __struct.version = buf.get_u8()?;
8910 let mut tmp = [0_u8; 25usize];
8911 for v in &mut tmp {
8912 *v = buf.get_u8()?;
8913 }
8914 __struct.passkey = CharArray::new(tmp);
8915 Ok(__struct)
8916 }
8917 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8918 let mut __tmp = BytesMut::new(bytes);
8919 #[allow(clippy::absurd_extreme_comparisons)]
8920 #[allow(unused_comparisons)]
8921 if __tmp.remaining() < Self::ENCODED_LEN {
8922 panic!(
8923 "buffer is too small (need {} bytes, but got {})",
8924 Self::ENCODED_LEN,
8925 __tmp.remaining(),
8926 )
8927 }
8928 __tmp.put_u8(self.target_system);
8929 __tmp.put_u8(self.control_request);
8930 __tmp.put_u8(self.version);
8931 for val in &self.passkey {
8932 __tmp.put_u8(*val);
8933 }
8934 if matches!(version, MavlinkVersion::V2) {
8935 let len = __tmp.len();
8936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8937 } else {
8938 __tmp.len()
8939 }
8940 }
8941}
8942#[doc = "Accept / deny control of this MAV."]
8943#[doc = ""]
8944#[doc = "ID: 6"]
8945#[derive(Debug, Clone, PartialEq)]
8946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8948#[cfg_attr(feature = "ts", derive(TS))]
8949#[cfg_attr(feature = "ts", ts(export))]
8950pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8951 #[doc = "ID of the GCS this message"]
8952 pub gcs_system_id: u8,
8953 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8954 pub control_request: u8,
8955 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8956 pub ack: u8,
8957}
8958impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8959 pub const ENCODED_LEN: usize = 3usize;
8960 pub const DEFAULT: Self = Self {
8961 gcs_system_id: 0_u8,
8962 control_request: 0_u8,
8963 ack: 0_u8,
8964 };
8965 #[cfg(feature = "arbitrary")]
8966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8967 use arbitrary::{Arbitrary, Unstructured};
8968 let mut buf = [0u8; 1024];
8969 rng.fill_bytes(&mut buf);
8970 let mut unstructured = Unstructured::new(&buf);
8971 Self::arbitrary(&mut unstructured).unwrap_or_default()
8972 }
8973}
8974impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8975 fn default() -> Self {
8976 Self::DEFAULT.clone()
8977 }
8978}
8979impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8980 type Message = MavMessage;
8981 const ID: u32 = 6u32;
8982 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8983 const EXTRA_CRC: u8 = 104u8;
8984 const ENCODED_LEN: usize = 3usize;
8985 fn deser(
8986 _version: MavlinkVersion,
8987 __input: &[u8],
8988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8989 let avail_len = __input.len();
8990 let mut payload_buf = [0; Self::ENCODED_LEN];
8991 let mut buf = if avail_len < Self::ENCODED_LEN {
8992 payload_buf[0..avail_len].copy_from_slice(__input);
8993 Bytes::new(&payload_buf)
8994 } else {
8995 Bytes::new(__input)
8996 };
8997 let mut __struct = Self::default();
8998 __struct.gcs_system_id = buf.get_u8()?;
8999 __struct.control_request = buf.get_u8()?;
9000 __struct.ack = buf.get_u8()?;
9001 Ok(__struct)
9002 }
9003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9004 let mut __tmp = BytesMut::new(bytes);
9005 #[allow(clippy::absurd_extreme_comparisons)]
9006 #[allow(unused_comparisons)]
9007 if __tmp.remaining() < Self::ENCODED_LEN {
9008 panic!(
9009 "buffer is too small (need {} bytes, but got {})",
9010 Self::ENCODED_LEN,
9011 __tmp.remaining(),
9012 )
9013 }
9014 __tmp.put_u8(self.gcs_system_id);
9015 __tmp.put_u8(self.control_request);
9016 __tmp.put_u8(self.ack);
9017 if matches!(version, MavlinkVersion::V2) {
9018 let len = __tmp.len();
9019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9020 } else {
9021 __tmp.len()
9022 }
9023 }
9024}
9025#[doc = "Information about a potential collision."]
9026#[doc = ""]
9027#[doc = "ID: 247"]
9028#[derive(Debug, Clone, PartialEq)]
9029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9031#[cfg_attr(feature = "ts", derive(TS))]
9032#[cfg_attr(feature = "ts", ts(export))]
9033pub struct COLLISION_DATA {
9034 #[doc = "Unique identifier, domain based on src field"]
9035 pub id: u32,
9036 #[doc = "Estimated time until collision occurs"]
9037 pub time_to_minimum_delta: f32,
9038 #[doc = "Closest vertical distance between vehicle and object"]
9039 pub altitude_minimum_delta: f32,
9040 #[doc = "Closest horizontal distance between vehicle and object"]
9041 pub horizontal_minimum_delta: f32,
9042 #[doc = "Collision data source"]
9043 pub src: MavCollisionSrc,
9044 #[doc = "Action that is being taken to avoid this collision"]
9045 pub action: MavCollisionAction,
9046 #[doc = "How concerned the aircraft is about this collision"]
9047 pub threat_level: MavCollisionThreatLevel,
9048}
9049impl COLLISION_DATA {
9050 pub const ENCODED_LEN: usize = 19usize;
9051 pub const DEFAULT: Self = Self {
9052 id: 0_u32,
9053 time_to_minimum_delta: 0.0_f32,
9054 altitude_minimum_delta: 0.0_f32,
9055 horizontal_minimum_delta: 0.0_f32,
9056 src: MavCollisionSrc::DEFAULT,
9057 action: MavCollisionAction::DEFAULT,
9058 threat_level: MavCollisionThreatLevel::DEFAULT,
9059 };
9060 #[cfg(feature = "arbitrary")]
9061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9062 use arbitrary::{Arbitrary, Unstructured};
9063 let mut buf = [0u8; 1024];
9064 rng.fill_bytes(&mut buf);
9065 let mut unstructured = Unstructured::new(&buf);
9066 Self::arbitrary(&mut unstructured).unwrap_or_default()
9067 }
9068}
9069impl Default for COLLISION_DATA {
9070 fn default() -> Self {
9071 Self::DEFAULT.clone()
9072 }
9073}
9074impl MessageData for COLLISION_DATA {
9075 type Message = MavMessage;
9076 const ID: u32 = 247u32;
9077 const NAME: &'static str = "COLLISION";
9078 const EXTRA_CRC: u8 = 81u8;
9079 const ENCODED_LEN: usize = 19usize;
9080 fn deser(
9081 _version: MavlinkVersion,
9082 __input: &[u8],
9083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9084 let avail_len = __input.len();
9085 let mut payload_buf = [0; Self::ENCODED_LEN];
9086 let mut buf = if avail_len < Self::ENCODED_LEN {
9087 payload_buf[0..avail_len].copy_from_slice(__input);
9088 Bytes::new(&payload_buf)
9089 } else {
9090 Bytes::new(__input)
9091 };
9092 let mut __struct = Self::default();
9093 __struct.id = buf.get_u32_le()?;
9094 __struct.time_to_minimum_delta = buf.get_f32_le()?;
9095 __struct.altitude_minimum_delta = buf.get_f32_le()?;
9096 __struct.horizontal_minimum_delta = buf.get_f32_le()?;
9097 let tmp = buf.get_u8()?;
9098 __struct.src =
9099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9100 enum_type: "MavCollisionSrc",
9101 value: tmp as u64,
9102 })?;
9103 let tmp = buf.get_u8()?;
9104 __struct.action =
9105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9106 enum_type: "MavCollisionAction",
9107 value: tmp as u64,
9108 })?;
9109 let tmp = buf.get_u8()?;
9110 __struct.threat_level =
9111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9112 enum_type: "MavCollisionThreatLevel",
9113 value: tmp as u64,
9114 })?;
9115 Ok(__struct)
9116 }
9117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9118 let mut __tmp = BytesMut::new(bytes);
9119 #[allow(clippy::absurd_extreme_comparisons)]
9120 #[allow(unused_comparisons)]
9121 if __tmp.remaining() < Self::ENCODED_LEN {
9122 panic!(
9123 "buffer is too small (need {} bytes, but got {})",
9124 Self::ENCODED_LEN,
9125 __tmp.remaining(),
9126 )
9127 }
9128 __tmp.put_u32_le(self.id);
9129 __tmp.put_f32_le(self.time_to_minimum_delta);
9130 __tmp.put_f32_le(self.altitude_minimum_delta);
9131 __tmp.put_f32_le(self.horizontal_minimum_delta);
9132 __tmp.put_u8(self.src as u8);
9133 __tmp.put_u8(self.action as u8);
9134 __tmp.put_u8(self.threat_level as u8);
9135 if matches!(version, MavlinkVersion::V2) {
9136 let len = __tmp.len();
9137 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9138 } else {
9139 __tmp.len()
9140 }
9141 }
9142}
9143#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9144#[doc = ""]
9145#[doc = "ID: 77"]
9146#[derive(Debug, Clone, PartialEq)]
9147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9149#[cfg_attr(feature = "ts", derive(TS))]
9150#[cfg_attr(feature = "ts", ts(export))]
9151pub struct COMMAND_ACK_DATA {
9152 #[doc = "Command ID (of acknowledged command)."]
9153 pub command: MavCmd,
9154 #[doc = "Result of command."]
9155 pub result: MavResult,
9156 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9157 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9158 pub progress: u8,
9159 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9161 pub result_param2: i32,
9162 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9164 pub target_system: u8,
9165 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9167 pub target_component: u8,
9168}
9169impl COMMAND_ACK_DATA {
9170 pub const ENCODED_LEN: usize = 10usize;
9171 pub const DEFAULT: Self = Self {
9172 command: MavCmd::DEFAULT,
9173 result: MavResult::DEFAULT,
9174 progress: 0_u8,
9175 result_param2: 0_i32,
9176 target_system: 0_u8,
9177 target_component: 0_u8,
9178 };
9179 #[cfg(feature = "arbitrary")]
9180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9181 use arbitrary::{Arbitrary, Unstructured};
9182 let mut buf = [0u8; 1024];
9183 rng.fill_bytes(&mut buf);
9184 let mut unstructured = Unstructured::new(&buf);
9185 Self::arbitrary(&mut unstructured).unwrap_or_default()
9186 }
9187}
9188impl Default for COMMAND_ACK_DATA {
9189 fn default() -> Self {
9190 Self::DEFAULT.clone()
9191 }
9192}
9193impl MessageData for COMMAND_ACK_DATA {
9194 type Message = MavMessage;
9195 const ID: u32 = 77u32;
9196 const NAME: &'static str = "COMMAND_ACK";
9197 const EXTRA_CRC: u8 = 143u8;
9198 const ENCODED_LEN: usize = 10usize;
9199 fn deser(
9200 _version: MavlinkVersion,
9201 __input: &[u8],
9202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9203 let avail_len = __input.len();
9204 let mut payload_buf = [0; Self::ENCODED_LEN];
9205 let mut buf = if avail_len < Self::ENCODED_LEN {
9206 payload_buf[0..avail_len].copy_from_slice(__input);
9207 Bytes::new(&payload_buf)
9208 } else {
9209 Bytes::new(__input)
9210 };
9211 let mut __struct = Self::default();
9212 let tmp = buf.get_u16_le()?;
9213 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9214 ::mavlink_core::error::ParserError::InvalidEnum {
9215 enum_type: "MavCmd",
9216 value: tmp as u64,
9217 },
9218 )?;
9219 let tmp = buf.get_u8()?;
9220 __struct.result =
9221 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9222 enum_type: "MavResult",
9223 value: tmp as u64,
9224 })?;
9225 __struct.progress = buf.get_u8()?;
9226 __struct.result_param2 = buf.get_i32_le()?;
9227 __struct.target_system = buf.get_u8()?;
9228 __struct.target_component = buf.get_u8()?;
9229 Ok(__struct)
9230 }
9231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9232 let mut __tmp = BytesMut::new(bytes);
9233 #[allow(clippy::absurd_extreme_comparisons)]
9234 #[allow(unused_comparisons)]
9235 if __tmp.remaining() < Self::ENCODED_LEN {
9236 panic!(
9237 "buffer is too small (need {} bytes, but got {})",
9238 Self::ENCODED_LEN,
9239 __tmp.remaining(),
9240 )
9241 }
9242 __tmp.put_u16_le(self.command as u16);
9243 __tmp.put_u8(self.result as u8);
9244 if matches!(version, MavlinkVersion::V2) {
9245 __tmp.put_u8(self.progress);
9246 __tmp.put_i32_le(self.result_param2);
9247 __tmp.put_u8(self.target_system);
9248 __tmp.put_u8(self.target_component);
9249 let len = __tmp.len();
9250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9251 } else {
9252 __tmp.len()
9253 }
9254 }
9255}
9256#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9257#[doc = ""]
9258#[doc = "ID: 80"]
9259#[derive(Debug, Clone, PartialEq)]
9260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9262#[cfg_attr(feature = "ts", derive(TS))]
9263#[cfg_attr(feature = "ts", ts(export))]
9264pub struct COMMAND_CANCEL_DATA {
9265 #[doc = "Command ID (of command to cancel)."]
9266 pub command: MavCmd,
9267 #[doc = "System executing long running command. Should not be broadcast (0)."]
9268 pub target_system: u8,
9269 #[doc = "Component executing long running command."]
9270 pub target_component: u8,
9271}
9272impl COMMAND_CANCEL_DATA {
9273 pub const ENCODED_LEN: usize = 4usize;
9274 pub const DEFAULT: Self = Self {
9275 command: MavCmd::DEFAULT,
9276 target_system: 0_u8,
9277 target_component: 0_u8,
9278 };
9279 #[cfg(feature = "arbitrary")]
9280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9281 use arbitrary::{Arbitrary, Unstructured};
9282 let mut buf = [0u8; 1024];
9283 rng.fill_bytes(&mut buf);
9284 let mut unstructured = Unstructured::new(&buf);
9285 Self::arbitrary(&mut unstructured).unwrap_or_default()
9286 }
9287}
9288impl Default for COMMAND_CANCEL_DATA {
9289 fn default() -> Self {
9290 Self::DEFAULT.clone()
9291 }
9292}
9293impl MessageData for COMMAND_CANCEL_DATA {
9294 type Message = MavMessage;
9295 const ID: u32 = 80u32;
9296 const NAME: &'static str = "COMMAND_CANCEL";
9297 const EXTRA_CRC: u8 = 14u8;
9298 const ENCODED_LEN: usize = 4usize;
9299 fn deser(
9300 _version: MavlinkVersion,
9301 __input: &[u8],
9302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9303 let avail_len = __input.len();
9304 let mut payload_buf = [0; Self::ENCODED_LEN];
9305 let mut buf = if avail_len < Self::ENCODED_LEN {
9306 payload_buf[0..avail_len].copy_from_slice(__input);
9307 Bytes::new(&payload_buf)
9308 } else {
9309 Bytes::new(__input)
9310 };
9311 let mut __struct = Self::default();
9312 let tmp = buf.get_u16_le()?;
9313 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9314 ::mavlink_core::error::ParserError::InvalidEnum {
9315 enum_type: "MavCmd",
9316 value: tmp as u64,
9317 },
9318 )?;
9319 __struct.target_system = buf.get_u8()?;
9320 __struct.target_component = buf.get_u8()?;
9321 Ok(__struct)
9322 }
9323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9324 let mut __tmp = BytesMut::new(bytes);
9325 #[allow(clippy::absurd_extreme_comparisons)]
9326 #[allow(unused_comparisons)]
9327 if __tmp.remaining() < Self::ENCODED_LEN {
9328 panic!(
9329 "buffer is too small (need {} bytes, but got {})",
9330 Self::ENCODED_LEN,
9331 __tmp.remaining(),
9332 )
9333 }
9334 __tmp.put_u16_le(self.command as u16);
9335 __tmp.put_u8(self.target_system);
9336 __tmp.put_u8(self.target_component);
9337 if matches!(version, MavlinkVersion::V2) {
9338 let len = __tmp.len();
9339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9340 } else {
9341 __tmp.len()
9342 }
9343 }
9344}
9345#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9346#[doc = ""]
9347#[doc = "ID: 75"]
9348#[derive(Debug, Clone, PartialEq)]
9349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9351#[cfg_attr(feature = "ts", derive(TS))]
9352#[cfg_attr(feature = "ts", ts(export))]
9353pub struct COMMAND_INT_DATA {
9354 #[doc = "PARAM1, see MAV_CMD enum"]
9355 pub param1: f32,
9356 #[doc = "PARAM2, see MAV_CMD enum"]
9357 pub param2: f32,
9358 #[doc = "PARAM3, see MAV_CMD enum"]
9359 pub param3: f32,
9360 #[doc = "PARAM4, see MAV_CMD enum"]
9361 pub param4: f32,
9362 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9363 pub x: i32,
9364 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9365 pub y: i32,
9366 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9367 pub z: f32,
9368 #[doc = "The scheduled action for the mission item."]
9369 pub command: MavCmd,
9370 #[doc = "System ID"]
9371 pub target_system: u8,
9372 #[doc = "Component ID"]
9373 pub target_component: u8,
9374 #[doc = "The coordinate system of the COMMAND."]
9375 pub frame: MavFrame,
9376 #[doc = "Not used."]
9377 pub current: u8,
9378 #[doc = "Not used (set 0)."]
9379 pub autocontinue: u8,
9380}
9381impl COMMAND_INT_DATA {
9382 pub const ENCODED_LEN: usize = 35usize;
9383 pub const DEFAULT: Self = Self {
9384 param1: 0.0_f32,
9385 param2: 0.0_f32,
9386 param3: 0.0_f32,
9387 param4: 0.0_f32,
9388 x: 0_i32,
9389 y: 0_i32,
9390 z: 0.0_f32,
9391 command: MavCmd::DEFAULT,
9392 target_system: 0_u8,
9393 target_component: 0_u8,
9394 frame: MavFrame::DEFAULT,
9395 current: 0_u8,
9396 autocontinue: 0_u8,
9397 };
9398 #[cfg(feature = "arbitrary")]
9399 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9400 use arbitrary::{Arbitrary, Unstructured};
9401 let mut buf = [0u8; 1024];
9402 rng.fill_bytes(&mut buf);
9403 let mut unstructured = Unstructured::new(&buf);
9404 Self::arbitrary(&mut unstructured).unwrap_or_default()
9405 }
9406}
9407impl Default for COMMAND_INT_DATA {
9408 fn default() -> Self {
9409 Self::DEFAULT.clone()
9410 }
9411}
9412impl MessageData for COMMAND_INT_DATA {
9413 type Message = MavMessage;
9414 const ID: u32 = 75u32;
9415 const NAME: &'static str = "COMMAND_INT";
9416 const EXTRA_CRC: u8 = 158u8;
9417 const ENCODED_LEN: usize = 35usize;
9418 fn deser(
9419 _version: MavlinkVersion,
9420 __input: &[u8],
9421 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9422 let avail_len = __input.len();
9423 let mut payload_buf = [0; Self::ENCODED_LEN];
9424 let mut buf = if avail_len < Self::ENCODED_LEN {
9425 payload_buf[0..avail_len].copy_from_slice(__input);
9426 Bytes::new(&payload_buf)
9427 } else {
9428 Bytes::new(__input)
9429 };
9430 let mut __struct = Self::default();
9431 __struct.param1 = buf.get_f32_le()?;
9432 __struct.param2 = buf.get_f32_le()?;
9433 __struct.param3 = buf.get_f32_le()?;
9434 __struct.param4 = buf.get_f32_le()?;
9435 __struct.x = buf.get_i32_le()?;
9436 __struct.y = buf.get_i32_le()?;
9437 __struct.z = buf.get_f32_le()?;
9438 let tmp = buf.get_u16_le()?;
9439 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9440 ::mavlink_core::error::ParserError::InvalidEnum {
9441 enum_type: "MavCmd",
9442 value: tmp as u64,
9443 },
9444 )?;
9445 __struct.target_system = buf.get_u8()?;
9446 __struct.target_component = buf.get_u8()?;
9447 let tmp = buf.get_u8()?;
9448 __struct.frame =
9449 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9450 enum_type: "MavFrame",
9451 value: tmp as u64,
9452 })?;
9453 __struct.current = buf.get_u8()?;
9454 __struct.autocontinue = buf.get_u8()?;
9455 Ok(__struct)
9456 }
9457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9458 let mut __tmp = BytesMut::new(bytes);
9459 #[allow(clippy::absurd_extreme_comparisons)]
9460 #[allow(unused_comparisons)]
9461 if __tmp.remaining() < Self::ENCODED_LEN {
9462 panic!(
9463 "buffer is too small (need {} bytes, but got {})",
9464 Self::ENCODED_LEN,
9465 __tmp.remaining(),
9466 )
9467 }
9468 __tmp.put_f32_le(self.param1);
9469 __tmp.put_f32_le(self.param2);
9470 __tmp.put_f32_le(self.param3);
9471 __tmp.put_f32_le(self.param4);
9472 __tmp.put_i32_le(self.x);
9473 __tmp.put_i32_le(self.y);
9474 __tmp.put_f32_le(self.z);
9475 __tmp.put_u16_le(self.command as u16);
9476 __tmp.put_u8(self.target_system);
9477 __tmp.put_u8(self.target_component);
9478 __tmp.put_u8(self.frame as u8);
9479 __tmp.put_u8(self.current);
9480 __tmp.put_u8(self.autocontinue);
9481 if matches!(version, MavlinkVersion::V2) {
9482 let len = __tmp.len();
9483 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9484 } else {
9485 __tmp.len()
9486 }
9487 }
9488}
9489#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9490#[doc = ""]
9491#[doc = "ID: 76"]
9492#[derive(Debug, Clone, PartialEq)]
9493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9495#[cfg_attr(feature = "ts", derive(TS))]
9496#[cfg_attr(feature = "ts", ts(export))]
9497pub struct COMMAND_LONG_DATA {
9498 #[doc = "Parameter 1 (for the specific command)."]
9499 pub param1: f32,
9500 #[doc = "Parameter 2 (for the specific command)."]
9501 pub param2: f32,
9502 #[doc = "Parameter 3 (for the specific command)."]
9503 pub param3: f32,
9504 #[doc = "Parameter 4 (for the specific command)."]
9505 pub param4: f32,
9506 #[doc = "Parameter 5 (for the specific command)."]
9507 pub param5: f32,
9508 #[doc = "Parameter 6 (for the specific command)."]
9509 pub param6: f32,
9510 #[doc = "Parameter 7 (for the specific command)."]
9511 pub param7: f32,
9512 #[doc = "Command ID (of command to send)."]
9513 pub command: MavCmd,
9514 #[doc = "System which should execute the command"]
9515 pub target_system: u8,
9516 #[doc = "Component which should execute the command, 0 for all components"]
9517 pub target_component: u8,
9518 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9519 pub confirmation: u8,
9520}
9521impl COMMAND_LONG_DATA {
9522 pub const ENCODED_LEN: usize = 33usize;
9523 pub const DEFAULT: Self = Self {
9524 param1: 0.0_f32,
9525 param2: 0.0_f32,
9526 param3: 0.0_f32,
9527 param4: 0.0_f32,
9528 param5: 0.0_f32,
9529 param6: 0.0_f32,
9530 param7: 0.0_f32,
9531 command: MavCmd::DEFAULT,
9532 target_system: 0_u8,
9533 target_component: 0_u8,
9534 confirmation: 0_u8,
9535 };
9536 #[cfg(feature = "arbitrary")]
9537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9538 use arbitrary::{Arbitrary, Unstructured};
9539 let mut buf = [0u8; 1024];
9540 rng.fill_bytes(&mut buf);
9541 let mut unstructured = Unstructured::new(&buf);
9542 Self::arbitrary(&mut unstructured).unwrap_or_default()
9543 }
9544}
9545impl Default for COMMAND_LONG_DATA {
9546 fn default() -> Self {
9547 Self::DEFAULT.clone()
9548 }
9549}
9550impl MessageData for COMMAND_LONG_DATA {
9551 type Message = MavMessage;
9552 const ID: u32 = 76u32;
9553 const NAME: &'static str = "COMMAND_LONG";
9554 const EXTRA_CRC: u8 = 152u8;
9555 const ENCODED_LEN: usize = 33usize;
9556 fn deser(
9557 _version: MavlinkVersion,
9558 __input: &[u8],
9559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9560 let avail_len = __input.len();
9561 let mut payload_buf = [0; Self::ENCODED_LEN];
9562 let mut buf = if avail_len < Self::ENCODED_LEN {
9563 payload_buf[0..avail_len].copy_from_slice(__input);
9564 Bytes::new(&payload_buf)
9565 } else {
9566 Bytes::new(__input)
9567 };
9568 let mut __struct = Self::default();
9569 __struct.param1 = buf.get_f32_le()?;
9570 __struct.param2 = buf.get_f32_le()?;
9571 __struct.param3 = buf.get_f32_le()?;
9572 __struct.param4 = buf.get_f32_le()?;
9573 __struct.param5 = buf.get_f32_le()?;
9574 __struct.param6 = buf.get_f32_le()?;
9575 __struct.param7 = buf.get_f32_le()?;
9576 let tmp = buf.get_u16_le()?;
9577 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9578 ::mavlink_core::error::ParserError::InvalidEnum {
9579 enum_type: "MavCmd",
9580 value: tmp as u64,
9581 },
9582 )?;
9583 __struct.target_system = buf.get_u8()?;
9584 __struct.target_component = buf.get_u8()?;
9585 __struct.confirmation = buf.get_u8()?;
9586 Ok(__struct)
9587 }
9588 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9589 let mut __tmp = BytesMut::new(bytes);
9590 #[allow(clippy::absurd_extreme_comparisons)]
9591 #[allow(unused_comparisons)]
9592 if __tmp.remaining() < Self::ENCODED_LEN {
9593 panic!(
9594 "buffer is too small (need {} bytes, but got {})",
9595 Self::ENCODED_LEN,
9596 __tmp.remaining(),
9597 )
9598 }
9599 __tmp.put_f32_le(self.param1);
9600 __tmp.put_f32_le(self.param2);
9601 __tmp.put_f32_le(self.param3);
9602 __tmp.put_f32_le(self.param4);
9603 __tmp.put_f32_le(self.param5);
9604 __tmp.put_f32_le(self.param6);
9605 __tmp.put_f32_le(self.param7);
9606 __tmp.put_u16_le(self.command as u16);
9607 __tmp.put_u8(self.target_system);
9608 __tmp.put_u8(self.target_component);
9609 __tmp.put_u8(self.confirmation);
9610 if matches!(version, MavlinkVersion::V2) {
9611 let len = __tmp.len();
9612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9613 } else {
9614 __tmp.len()
9615 }
9616 }
9617}
9618#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9619#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9620#[doc = ""]
9621#[doc = "ID: 395"]
9622#[derive(Debug, Clone, PartialEq)]
9623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9625#[cfg_attr(feature = "ts", derive(TS))]
9626#[cfg_attr(feature = "ts", ts(export))]
9627pub struct COMPONENT_INFORMATION_DATA {
9628 #[doc = "Timestamp (time since system boot)."]
9629 pub time_boot_ms: u32,
9630 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9631 pub general_metadata_file_crc: u32,
9632 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9633 pub peripherals_metadata_file_crc: u32,
9634 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9635 #[cfg_attr(feature = "ts", ts(type = "string"))]
9636 pub general_metadata_uri: CharArray<100>,
9637 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9638 #[cfg_attr(feature = "ts", ts(type = "string"))]
9639 pub peripherals_metadata_uri: CharArray<100>,
9640}
9641impl COMPONENT_INFORMATION_DATA {
9642 pub const ENCODED_LEN: usize = 212usize;
9643 pub const DEFAULT: Self = Self {
9644 time_boot_ms: 0_u32,
9645 general_metadata_file_crc: 0_u32,
9646 peripherals_metadata_file_crc: 0_u32,
9647 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9648 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9649 };
9650 #[cfg(feature = "arbitrary")]
9651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9652 use arbitrary::{Arbitrary, Unstructured};
9653 let mut buf = [0u8; 1024];
9654 rng.fill_bytes(&mut buf);
9655 let mut unstructured = Unstructured::new(&buf);
9656 Self::arbitrary(&mut unstructured).unwrap_or_default()
9657 }
9658}
9659impl Default for COMPONENT_INFORMATION_DATA {
9660 fn default() -> Self {
9661 Self::DEFAULT.clone()
9662 }
9663}
9664impl MessageData for COMPONENT_INFORMATION_DATA {
9665 type Message = MavMessage;
9666 const ID: u32 = 395u32;
9667 const NAME: &'static str = "COMPONENT_INFORMATION";
9668 const EXTRA_CRC: u8 = 0u8;
9669 const ENCODED_LEN: usize = 212usize;
9670 fn deser(
9671 _version: MavlinkVersion,
9672 __input: &[u8],
9673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9674 let avail_len = __input.len();
9675 let mut payload_buf = [0; Self::ENCODED_LEN];
9676 let mut buf = if avail_len < Self::ENCODED_LEN {
9677 payload_buf[0..avail_len].copy_from_slice(__input);
9678 Bytes::new(&payload_buf)
9679 } else {
9680 Bytes::new(__input)
9681 };
9682 let mut __struct = Self::default();
9683 __struct.time_boot_ms = buf.get_u32_le()?;
9684 __struct.general_metadata_file_crc = buf.get_u32_le()?;
9685 __struct.peripherals_metadata_file_crc = buf.get_u32_le()?;
9686 let mut tmp = [0_u8; 100usize];
9687 for v in &mut tmp {
9688 *v = buf.get_u8()?;
9689 }
9690 __struct.general_metadata_uri = CharArray::new(tmp);
9691 let mut tmp = [0_u8; 100usize];
9692 for v in &mut tmp {
9693 *v = buf.get_u8()?;
9694 }
9695 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9696 Ok(__struct)
9697 }
9698 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9699 let mut __tmp = BytesMut::new(bytes);
9700 #[allow(clippy::absurd_extreme_comparisons)]
9701 #[allow(unused_comparisons)]
9702 if __tmp.remaining() < Self::ENCODED_LEN {
9703 panic!(
9704 "buffer is too small (need {} bytes, but got {})",
9705 Self::ENCODED_LEN,
9706 __tmp.remaining(),
9707 )
9708 }
9709 __tmp.put_u32_le(self.time_boot_ms);
9710 __tmp.put_u32_le(self.general_metadata_file_crc);
9711 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9712 for val in &self.general_metadata_uri {
9713 __tmp.put_u8(*val);
9714 }
9715 for val in &self.peripherals_metadata_uri {
9716 __tmp.put_u8(*val);
9717 }
9718 if matches!(version, MavlinkVersion::V2) {
9719 let len = __tmp.len();
9720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9721 } else {
9722 __tmp.len()
9723 }
9724 }
9725}
9726#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9727#[doc = ""]
9728#[doc = "ID: 396"]
9729#[derive(Debug, Clone, PartialEq)]
9730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9732#[cfg_attr(feature = "ts", derive(TS))]
9733#[cfg_attr(feature = "ts", ts(export))]
9734pub struct COMPONENT_INFORMATION_BASIC_DATA {
9735 #[doc = "Component capability flags"]
9736 pub capabilities: MavProtocolCapability,
9737 #[doc = "Timestamp (time since system boot)."]
9738 pub time_boot_ms: u32,
9739 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9740 pub time_manufacture_s: u32,
9741 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9742 #[cfg_attr(feature = "ts", ts(type = "string"))]
9743 pub vendor_name: CharArray<32>,
9744 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9745 #[cfg_attr(feature = "ts", ts(type = "string"))]
9746 pub model_name: CharArray<32>,
9747 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9748 #[cfg_attr(feature = "ts", ts(type = "string"))]
9749 pub software_version: CharArray<24>,
9750 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9751 #[cfg_attr(feature = "ts", ts(type = "string"))]
9752 pub hardware_version: CharArray<24>,
9753 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9754 #[cfg_attr(feature = "ts", ts(type = "string"))]
9755 pub serial_number: CharArray<32>,
9756}
9757impl COMPONENT_INFORMATION_BASIC_DATA {
9758 pub const ENCODED_LEN: usize = 160usize;
9759 pub const DEFAULT: Self = Self {
9760 capabilities: MavProtocolCapability::DEFAULT,
9761 time_boot_ms: 0_u32,
9762 time_manufacture_s: 0_u32,
9763 vendor_name: CharArray::new([0_u8; 32usize]),
9764 model_name: CharArray::new([0_u8; 32usize]),
9765 software_version: CharArray::new([0_u8; 24usize]),
9766 hardware_version: CharArray::new([0_u8; 24usize]),
9767 serial_number: CharArray::new([0_u8; 32usize]),
9768 };
9769 #[cfg(feature = "arbitrary")]
9770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9771 use arbitrary::{Arbitrary, Unstructured};
9772 let mut buf = [0u8; 1024];
9773 rng.fill_bytes(&mut buf);
9774 let mut unstructured = Unstructured::new(&buf);
9775 Self::arbitrary(&mut unstructured).unwrap_or_default()
9776 }
9777}
9778impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9779 fn default() -> Self {
9780 Self::DEFAULT.clone()
9781 }
9782}
9783impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9784 type Message = MavMessage;
9785 const ID: u32 = 396u32;
9786 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9787 const EXTRA_CRC: u8 = 50u8;
9788 const ENCODED_LEN: usize = 160usize;
9789 fn deser(
9790 _version: MavlinkVersion,
9791 __input: &[u8],
9792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9793 let avail_len = __input.len();
9794 let mut payload_buf = [0; Self::ENCODED_LEN];
9795 let mut buf = if avail_len < Self::ENCODED_LEN {
9796 payload_buf[0..avail_len].copy_from_slice(__input);
9797 Bytes::new(&payload_buf)
9798 } else {
9799 Bytes::new(__input)
9800 };
9801 let mut __struct = Self::default();
9802 let tmp = buf.get_u64_le()?;
9803 __struct.capabilities = MavProtocolCapability::from_bits(
9804 tmp as <MavProtocolCapability as Flags>::Bits,
9805 )
9806 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9807 flag_type: "MavProtocolCapability",
9808 value: tmp as u64,
9809 })?;
9810 __struct.time_boot_ms = buf.get_u32_le()?;
9811 __struct.time_manufacture_s = buf.get_u32_le()?;
9812 let mut tmp = [0_u8; 32usize];
9813 for v in &mut tmp {
9814 *v = buf.get_u8()?;
9815 }
9816 __struct.vendor_name = CharArray::new(tmp);
9817 let mut tmp = [0_u8; 32usize];
9818 for v in &mut tmp {
9819 *v = buf.get_u8()?;
9820 }
9821 __struct.model_name = CharArray::new(tmp);
9822 let mut tmp = [0_u8; 24usize];
9823 for v in &mut tmp {
9824 *v = buf.get_u8()?;
9825 }
9826 __struct.software_version = CharArray::new(tmp);
9827 let mut tmp = [0_u8; 24usize];
9828 for v in &mut tmp {
9829 *v = buf.get_u8()?;
9830 }
9831 __struct.hardware_version = CharArray::new(tmp);
9832 let mut tmp = [0_u8; 32usize];
9833 for v in &mut tmp {
9834 *v = buf.get_u8()?;
9835 }
9836 __struct.serial_number = CharArray::new(tmp);
9837 Ok(__struct)
9838 }
9839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9840 let mut __tmp = BytesMut::new(bytes);
9841 #[allow(clippy::absurd_extreme_comparisons)]
9842 #[allow(unused_comparisons)]
9843 if __tmp.remaining() < Self::ENCODED_LEN {
9844 panic!(
9845 "buffer is too small (need {} bytes, but got {})",
9846 Self::ENCODED_LEN,
9847 __tmp.remaining(),
9848 )
9849 }
9850 __tmp.put_u64_le(self.capabilities.bits() as u64);
9851 __tmp.put_u32_le(self.time_boot_ms);
9852 __tmp.put_u32_le(self.time_manufacture_s);
9853 for val in &self.vendor_name {
9854 __tmp.put_u8(*val);
9855 }
9856 for val in &self.model_name {
9857 __tmp.put_u8(*val);
9858 }
9859 for val in &self.software_version {
9860 __tmp.put_u8(*val);
9861 }
9862 for val in &self.hardware_version {
9863 __tmp.put_u8(*val);
9864 }
9865 for val in &self.serial_number {
9866 __tmp.put_u8(*val);
9867 }
9868 if matches!(version, MavlinkVersion::V2) {
9869 let len = __tmp.len();
9870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9871 } else {
9872 __tmp.len()
9873 }
9874 }
9875}
9876#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9877#[doc = ""]
9878#[doc = "ID: 397"]
9879#[derive(Debug, Clone, PartialEq)]
9880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9882#[cfg_attr(feature = "ts", derive(TS))]
9883#[cfg_attr(feature = "ts", ts(export))]
9884pub struct COMPONENT_METADATA_DATA {
9885 #[doc = "Timestamp (time since system boot)."]
9886 pub time_boot_ms: u32,
9887 #[doc = "CRC32 of the general metadata file."]
9888 pub file_crc: u32,
9889 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9890 #[cfg_attr(feature = "ts", ts(type = "string"))]
9891 pub uri: CharArray<100>,
9892}
9893impl COMPONENT_METADATA_DATA {
9894 pub const ENCODED_LEN: usize = 108usize;
9895 pub const DEFAULT: Self = Self {
9896 time_boot_ms: 0_u32,
9897 file_crc: 0_u32,
9898 uri: CharArray::new([0_u8; 100usize]),
9899 };
9900 #[cfg(feature = "arbitrary")]
9901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9902 use arbitrary::{Arbitrary, Unstructured};
9903 let mut buf = [0u8; 1024];
9904 rng.fill_bytes(&mut buf);
9905 let mut unstructured = Unstructured::new(&buf);
9906 Self::arbitrary(&mut unstructured).unwrap_or_default()
9907 }
9908}
9909impl Default for COMPONENT_METADATA_DATA {
9910 fn default() -> Self {
9911 Self::DEFAULT.clone()
9912 }
9913}
9914impl MessageData for COMPONENT_METADATA_DATA {
9915 type Message = MavMessage;
9916 const ID: u32 = 397u32;
9917 const NAME: &'static str = "COMPONENT_METADATA";
9918 const EXTRA_CRC: u8 = 182u8;
9919 const ENCODED_LEN: usize = 108usize;
9920 fn deser(
9921 _version: MavlinkVersion,
9922 __input: &[u8],
9923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9924 let avail_len = __input.len();
9925 let mut payload_buf = [0; Self::ENCODED_LEN];
9926 let mut buf = if avail_len < Self::ENCODED_LEN {
9927 payload_buf[0..avail_len].copy_from_slice(__input);
9928 Bytes::new(&payload_buf)
9929 } else {
9930 Bytes::new(__input)
9931 };
9932 let mut __struct = Self::default();
9933 __struct.time_boot_ms = buf.get_u32_le()?;
9934 __struct.file_crc = buf.get_u32_le()?;
9935 let mut tmp = [0_u8; 100usize];
9936 for v in &mut tmp {
9937 *v = buf.get_u8()?;
9938 }
9939 __struct.uri = CharArray::new(tmp);
9940 Ok(__struct)
9941 }
9942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9943 let mut __tmp = BytesMut::new(bytes);
9944 #[allow(clippy::absurd_extreme_comparisons)]
9945 #[allow(unused_comparisons)]
9946 if __tmp.remaining() < Self::ENCODED_LEN {
9947 panic!(
9948 "buffer is too small (need {} bytes, but got {})",
9949 Self::ENCODED_LEN,
9950 __tmp.remaining(),
9951 )
9952 }
9953 __tmp.put_u32_le(self.time_boot_ms);
9954 __tmp.put_u32_le(self.file_crc);
9955 for val in &self.uri {
9956 __tmp.put_u8(*val);
9957 }
9958 if matches!(version, MavlinkVersion::V2) {
9959 let len = __tmp.len();
9960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9961 } else {
9962 __tmp.len()
9963 }
9964 }
9965}
9966#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9967#[doc = ""]
9968#[doc = "ID: 146"]
9969#[derive(Debug, Clone, PartialEq)]
9970#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9972#[cfg_attr(feature = "ts", derive(TS))]
9973#[cfg_attr(feature = "ts", ts(export))]
9974pub struct CONTROL_SYSTEM_STATE_DATA {
9975 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9976 pub time_usec: u64,
9977 #[doc = "X acceleration in body frame"]
9978 pub x_acc: f32,
9979 #[doc = "Y acceleration in body frame"]
9980 pub y_acc: f32,
9981 #[doc = "Z acceleration in body frame"]
9982 pub z_acc: f32,
9983 #[doc = "X velocity in body frame"]
9984 pub x_vel: f32,
9985 #[doc = "Y velocity in body frame"]
9986 pub y_vel: f32,
9987 #[doc = "Z velocity in body frame"]
9988 pub z_vel: f32,
9989 #[doc = "X position in local frame"]
9990 pub x_pos: f32,
9991 #[doc = "Y position in local frame"]
9992 pub y_pos: f32,
9993 #[doc = "Z position in local frame"]
9994 pub z_pos: f32,
9995 #[doc = "Airspeed, set to -1 if unknown"]
9996 pub airspeed: f32,
9997 #[doc = "Variance of body velocity estimate"]
9998 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9999 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10000 pub vel_variance: [f32; 3],
10001 #[doc = "Variance in local position"]
10002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10003 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10004 pub pos_variance: [f32; 3],
10005 #[doc = "The attitude, represented as Quaternion"]
10006 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10007 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10008 pub q: [f32; 4],
10009 #[doc = "Angular rate in roll axis"]
10010 pub roll_rate: f32,
10011 #[doc = "Angular rate in pitch axis"]
10012 pub pitch_rate: f32,
10013 #[doc = "Angular rate in yaw axis"]
10014 pub yaw_rate: f32,
10015}
10016impl CONTROL_SYSTEM_STATE_DATA {
10017 pub const ENCODED_LEN: usize = 100usize;
10018 pub const DEFAULT: Self = Self {
10019 time_usec: 0_u64,
10020 x_acc: 0.0_f32,
10021 y_acc: 0.0_f32,
10022 z_acc: 0.0_f32,
10023 x_vel: 0.0_f32,
10024 y_vel: 0.0_f32,
10025 z_vel: 0.0_f32,
10026 x_pos: 0.0_f32,
10027 y_pos: 0.0_f32,
10028 z_pos: 0.0_f32,
10029 airspeed: 0.0_f32,
10030 vel_variance: [0.0_f32; 3usize],
10031 pos_variance: [0.0_f32; 3usize],
10032 q: [0.0_f32; 4usize],
10033 roll_rate: 0.0_f32,
10034 pitch_rate: 0.0_f32,
10035 yaw_rate: 0.0_f32,
10036 };
10037 #[cfg(feature = "arbitrary")]
10038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10039 use arbitrary::{Arbitrary, Unstructured};
10040 let mut buf = [0u8; 1024];
10041 rng.fill_bytes(&mut buf);
10042 let mut unstructured = Unstructured::new(&buf);
10043 Self::arbitrary(&mut unstructured).unwrap_or_default()
10044 }
10045}
10046impl Default for CONTROL_SYSTEM_STATE_DATA {
10047 fn default() -> Self {
10048 Self::DEFAULT.clone()
10049 }
10050}
10051impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10052 type Message = MavMessage;
10053 const ID: u32 = 146u32;
10054 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10055 const EXTRA_CRC: u8 = 103u8;
10056 const ENCODED_LEN: usize = 100usize;
10057 fn deser(
10058 _version: MavlinkVersion,
10059 __input: &[u8],
10060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10061 let avail_len = __input.len();
10062 let mut payload_buf = [0; Self::ENCODED_LEN];
10063 let mut buf = if avail_len < Self::ENCODED_LEN {
10064 payload_buf[0..avail_len].copy_from_slice(__input);
10065 Bytes::new(&payload_buf)
10066 } else {
10067 Bytes::new(__input)
10068 };
10069 let mut __struct = Self::default();
10070 __struct.time_usec = buf.get_u64_le()?;
10071 __struct.x_acc = buf.get_f32_le()?;
10072 __struct.y_acc = buf.get_f32_le()?;
10073 __struct.z_acc = buf.get_f32_le()?;
10074 __struct.x_vel = buf.get_f32_le()?;
10075 __struct.y_vel = buf.get_f32_le()?;
10076 __struct.z_vel = buf.get_f32_le()?;
10077 __struct.x_pos = buf.get_f32_le()?;
10078 __struct.y_pos = buf.get_f32_le()?;
10079 __struct.z_pos = buf.get_f32_le()?;
10080 __struct.airspeed = buf.get_f32_le()?;
10081 for v in &mut __struct.vel_variance {
10082 let val = buf.get_f32_le()?;
10083 *v = val;
10084 }
10085 for v in &mut __struct.pos_variance {
10086 let val = buf.get_f32_le()?;
10087 *v = val;
10088 }
10089 for v in &mut __struct.q {
10090 let val = buf.get_f32_le()?;
10091 *v = val;
10092 }
10093 __struct.roll_rate = buf.get_f32_le()?;
10094 __struct.pitch_rate = buf.get_f32_le()?;
10095 __struct.yaw_rate = buf.get_f32_le()?;
10096 Ok(__struct)
10097 }
10098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10099 let mut __tmp = BytesMut::new(bytes);
10100 #[allow(clippy::absurd_extreme_comparisons)]
10101 #[allow(unused_comparisons)]
10102 if __tmp.remaining() < Self::ENCODED_LEN {
10103 panic!(
10104 "buffer is too small (need {} bytes, but got {})",
10105 Self::ENCODED_LEN,
10106 __tmp.remaining(),
10107 )
10108 }
10109 __tmp.put_u64_le(self.time_usec);
10110 __tmp.put_f32_le(self.x_acc);
10111 __tmp.put_f32_le(self.y_acc);
10112 __tmp.put_f32_le(self.z_acc);
10113 __tmp.put_f32_le(self.x_vel);
10114 __tmp.put_f32_le(self.y_vel);
10115 __tmp.put_f32_le(self.z_vel);
10116 __tmp.put_f32_le(self.x_pos);
10117 __tmp.put_f32_le(self.y_pos);
10118 __tmp.put_f32_le(self.z_pos);
10119 __tmp.put_f32_le(self.airspeed);
10120 for val in &self.vel_variance {
10121 __tmp.put_f32_le(*val);
10122 }
10123 for val in &self.pos_variance {
10124 __tmp.put_f32_le(*val);
10125 }
10126 for val in &self.q {
10127 __tmp.put_f32_le(*val);
10128 }
10129 __tmp.put_f32_le(self.roll_rate);
10130 __tmp.put_f32_le(self.pitch_rate);
10131 __tmp.put_f32_le(self.yaw_rate);
10132 if matches!(version, MavlinkVersion::V2) {
10133 let len = __tmp.len();
10134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10135 } else {
10136 __tmp.len()
10137 }
10138 }
10139}
10140#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10141#[doc = ""]
10142#[doc = "ID: 411"]
10143#[derive(Debug, Clone, PartialEq)]
10144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10146#[cfg_attr(feature = "ts", derive(TS))]
10147#[cfg_attr(feature = "ts", ts(export))]
10148pub struct CURRENT_EVENT_SEQUENCE_DATA {
10149 #[doc = "Sequence number."]
10150 pub sequence: u16,
10151 #[doc = "Flag bitset."]
10152 pub flags: MavEventCurrentSequenceFlags,
10153}
10154impl CURRENT_EVENT_SEQUENCE_DATA {
10155 pub const ENCODED_LEN: usize = 3usize;
10156 pub const DEFAULT: Self = Self {
10157 sequence: 0_u16,
10158 flags: MavEventCurrentSequenceFlags::DEFAULT,
10159 };
10160 #[cfg(feature = "arbitrary")]
10161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10162 use arbitrary::{Arbitrary, Unstructured};
10163 let mut buf = [0u8; 1024];
10164 rng.fill_bytes(&mut buf);
10165 let mut unstructured = Unstructured::new(&buf);
10166 Self::arbitrary(&mut unstructured).unwrap_or_default()
10167 }
10168}
10169impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10170 fn default() -> Self {
10171 Self::DEFAULT.clone()
10172 }
10173}
10174impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10175 type Message = MavMessage;
10176 const ID: u32 = 411u32;
10177 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10178 const EXTRA_CRC: u8 = 106u8;
10179 const ENCODED_LEN: usize = 3usize;
10180 fn deser(
10181 _version: MavlinkVersion,
10182 __input: &[u8],
10183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10184 let avail_len = __input.len();
10185 let mut payload_buf = [0; Self::ENCODED_LEN];
10186 let mut buf = if avail_len < Self::ENCODED_LEN {
10187 payload_buf[0..avail_len].copy_from_slice(__input);
10188 Bytes::new(&payload_buf)
10189 } else {
10190 Bytes::new(__input)
10191 };
10192 let mut __struct = Self::default();
10193 __struct.sequence = buf.get_u16_le()?;
10194 let tmp = buf.get_u8()?;
10195 __struct.flags =
10196 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10197 enum_type: "MavEventCurrentSequenceFlags",
10198 value: tmp as u64,
10199 })?;
10200 Ok(__struct)
10201 }
10202 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10203 let mut __tmp = BytesMut::new(bytes);
10204 #[allow(clippy::absurd_extreme_comparisons)]
10205 #[allow(unused_comparisons)]
10206 if __tmp.remaining() < Self::ENCODED_LEN {
10207 panic!(
10208 "buffer is too small (need {} bytes, but got {})",
10209 Self::ENCODED_LEN,
10210 __tmp.remaining(),
10211 )
10212 }
10213 __tmp.put_u16_le(self.sequence);
10214 __tmp.put_u8(self.flags as u8);
10215 if matches!(version, MavlinkVersion::V2) {
10216 let len = __tmp.len();
10217 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10218 } else {
10219 __tmp.len()
10220 }
10221 }
10222}
10223#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10224#[doc = ""]
10225#[doc = "ID: 436"]
10226#[derive(Debug, Clone, PartialEq)]
10227#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10228#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10229#[cfg_attr(feature = "ts", derive(TS))]
10230#[cfg_attr(feature = "ts", ts(export))]
10231pub struct CURRENT_MODE_DATA {
10232 #[doc = "A bitfield for use for autopilot-specific flags"]
10233 pub custom_mode: u32,
10234 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10235 pub intended_custom_mode: u32,
10236 #[doc = "Standard mode."]
10237 pub standard_mode: MavStandardMode,
10238}
10239impl CURRENT_MODE_DATA {
10240 pub const ENCODED_LEN: usize = 9usize;
10241 pub const DEFAULT: Self = Self {
10242 custom_mode: 0_u32,
10243 intended_custom_mode: 0_u32,
10244 standard_mode: MavStandardMode::DEFAULT,
10245 };
10246 #[cfg(feature = "arbitrary")]
10247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10248 use arbitrary::{Arbitrary, Unstructured};
10249 let mut buf = [0u8; 1024];
10250 rng.fill_bytes(&mut buf);
10251 let mut unstructured = Unstructured::new(&buf);
10252 Self::arbitrary(&mut unstructured).unwrap_or_default()
10253 }
10254}
10255impl Default for CURRENT_MODE_DATA {
10256 fn default() -> Self {
10257 Self::DEFAULT.clone()
10258 }
10259}
10260impl MessageData for CURRENT_MODE_DATA {
10261 type Message = MavMessage;
10262 const ID: u32 = 436u32;
10263 const NAME: &'static str = "CURRENT_MODE";
10264 const EXTRA_CRC: u8 = 193u8;
10265 const ENCODED_LEN: usize = 9usize;
10266 fn deser(
10267 _version: MavlinkVersion,
10268 __input: &[u8],
10269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10270 let avail_len = __input.len();
10271 let mut payload_buf = [0; Self::ENCODED_LEN];
10272 let mut buf = if avail_len < Self::ENCODED_LEN {
10273 payload_buf[0..avail_len].copy_from_slice(__input);
10274 Bytes::new(&payload_buf)
10275 } else {
10276 Bytes::new(__input)
10277 };
10278 let mut __struct = Self::default();
10279 __struct.custom_mode = buf.get_u32_le()?;
10280 __struct.intended_custom_mode = buf.get_u32_le()?;
10281 let tmp = buf.get_u8()?;
10282 __struct.standard_mode =
10283 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10284 enum_type: "MavStandardMode",
10285 value: tmp as u64,
10286 })?;
10287 Ok(__struct)
10288 }
10289 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10290 let mut __tmp = BytesMut::new(bytes);
10291 #[allow(clippy::absurd_extreme_comparisons)]
10292 #[allow(unused_comparisons)]
10293 if __tmp.remaining() < Self::ENCODED_LEN {
10294 panic!(
10295 "buffer is too small (need {} bytes, but got {})",
10296 Self::ENCODED_LEN,
10297 __tmp.remaining(),
10298 )
10299 }
10300 __tmp.put_u32_le(self.custom_mode);
10301 __tmp.put_u32_le(self.intended_custom_mode);
10302 __tmp.put_u8(self.standard_mode as u8);
10303 if matches!(version, MavlinkVersion::V2) {
10304 let len = __tmp.len();
10305 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10306 } else {
10307 __tmp.len()
10308 }
10309 }
10310}
10311#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10312#[doc = "Data stream status information."]
10313#[doc = ""]
10314#[doc = "ID: 67"]
10315#[derive(Debug, Clone, PartialEq)]
10316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10318#[cfg_attr(feature = "ts", derive(TS))]
10319#[cfg_attr(feature = "ts", ts(export))]
10320pub struct DATA_STREAM_DATA {
10321 #[doc = "The message rate"]
10322 pub message_rate: u16,
10323 #[doc = "The ID of the requested data stream"]
10324 pub stream_id: u8,
10325 #[doc = "1 stream is enabled, 0 stream is stopped."]
10326 pub on_off: u8,
10327}
10328impl DATA_STREAM_DATA {
10329 pub const ENCODED_LEN: usize = 4usize;
10330 pub const DEFAULT: Self = Self {
10331 message_rate: 0_u16,
10332 stream_id: 0_u8,
10333 on_off: 0_u8,
10334 };
10335 #[cfg(feature = "arbitrary")]
10336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10337 use arbitrary::{Arbitrary, Unstructured};
10338 let mut buf = [0u8; 1024];
10339 rng.fill_bytes(&mut buf);
10340 let mut unstructured = Unstructured::new(&buf);
10341 Self::arbitrary(&mut unstructured).unwrap_or_default()
10342 }
10343}
10344impl Default for DATA_STREAM_DATA {
10345 fn default() -> Self {
10346 Self::DEFAULT.clone()
10347 }
10348}
10349impl MessageData for DATA_STREAM_DATA {
10350 type Message = MavMessage;
10351 const ID: u32 = 67u32;
10352 const NAME: &'static str = "DATA_STREAM";
10353 const EXTRA_CRC: u8 = 21u8;
10354 const ENCODED_LEN: usize = 4usize;
10355 fn deser(
10356 _version: MavlinkVersion,
10357 __input: &[u8],
10358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10359 let avail_len = __input.len();
10360 let mut payload_buf = [0; Self::ENCODED_LEN];
10361 let mut buf = if avail_len < Self::ENCODED_LEN {
10362 payload_buf[0..avail_len].copy_from_slice(__input);
10363 Bytes::new(&payload_buf)
10364 } else {
10365 Bytes::new(__input)
10366 };
10367 let mut __struct = Self::default();
10368 __struct.message_rate = buf.get_u16_le()?;
10369 __struct.stream_id = buf.get_u8()?;
10370 __struct.on_off = buf.get_u8()?;
10371 Ok(__struct)
10372 }
10373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10374 let mut __tmp = BytesMut::new(bytes);
10375 #[allow(clippy::absurd_extreme_comparisons)]
10376 #[allow(unused_comparisons)]
10377 if __tmp.remaining() < Self::ENCODED_LEN {
10378 panic!(
10379 "buffer is too small (need {} bytes, but got {})",
10380 Self::ENCODED_LEN,
10381 __tmp.remaining(),
10382 )
10383 }
10384 __tmp.put_u16_le(self.message_rate);
10385 __tmp.put_u8(self.stream_id);
10386 __tmp.put_u8(self.on_off);
10387 if matches!(version, MavlinkVersion::V2) {
10388 let len = __tmp.len();
10389 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10390 } else {
10391 __tmp.len()
10392 }
10393 }
10394}
10395#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10396#[doc = ""]
10397#[doc = "ID: 130"]
10398#[derive(Debug, Clone, PartialEq)]
10399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10401#[cfg_attr(feature = "ts", derive(TS))]
10402#[cfg_attr(feature = "ts", ts(export))]
10403pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10404 #[doc = "total data size (set on ACK only)."]
10405 pub size: u32,
10406 #[doc = "Width of a matrix or image."]
10407 pub width: u16,
10408 #[doc = "Height of a matrix or image."]
10409 pub height: u16,
10410 #[doc = "Number of packets being sent (set on ACK only)."]
10411 pub packets: u16,
10412 #[doc = "Type of requested/acknowledged data."]
10413 pub mavtype: MavlinkDataStreamType,
10414 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10415 pub payload: u8,
10416 #[doc = "JPEG quality. Values: [1-100]."]
10417 pub jpg_quality: u8,
10418}
10419impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10420 pub const ENCODED_LEN: usize = 13usize;
10421 pub const DEFAULT: Self = Self {
10422 size: 0_u32,
10423 width: 0_u16,
10424 height: 0_u16,
10425 packets: 0_u16,
10426 mavtype: MavlinkDataStreamType::DEFAULT,
10427 payload: 0_u8,
10428 jpg_quality: 0_u8,
10429 };
10430 #[cfg(feature = "arbitrary")]
10431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10432 use arbitrary::{Arbitrary, Unstructured};
10433 let mut buf = [0u8; 1024];
10434 rng.fill_bytes(&mut buf);
10435 let mut unstructured = Unstructured::new(&buf);
10436 Self::arbitrary(&mut unstructured).unwrap_or_default()
10437 }
10438}
10439impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10440 fn default() -> Self {
10441 Self::DEFAULT.clone()
10442 }
10443}
10444impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10445 type Message = MavMessage;
10446 const ID: u32 = 130u32;
10447 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10448 const EXTRA_CRC: u8 = 29u8;
10449 const ENCODED_LEN: usize = 13usize;
10450 fn deser(
10451 _version: MavlinkVersion,
10452 __input: &[u8],
10453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10454 let avail_len = __input.len();
10455 let mut payload_buf = [0; Self::ENCODED_LEN];
10456 let mut buf = if avail_len < Self::ENCODED_LEN {
10457 payload_buf[0..avail_len].copy_from_slice(__input);
10458 Bytes::new(&payload_buf)
10459 } else {
10460 Bytes::new(__input)
10461 };
10462 let mut __struct = Self::default();
10463 __struct.size = buf.get_u32_le()?;
10464 __struct.width = buf.get_u16_le()?;
10465 __struct.height = buf.get_u16_le()?;
10466 __struct.packets = buf.get_u16_le()?;
10467 let tmp = buf.get_u8()?;
10468 __struct.mavtype =
10469 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10470 enum_type: "MavlinkDataStreamType",
10471 value: tmp as u64,
10472 })?;
10473 __struct.payload = buf.get_u8()?;
10474 __struct.jpg_quality = buf.get_u8()?;
10475 Ok(__struct)
10476 }
10477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10478 let mut __tmp = BytesMut::new(bytes);
10479 #[allow(clippy::absurd_extreme_comparisons)]
10480 #[allow(unused_comparisons)]
10481 if __tmp.remaining() < Self::ENCODED_LEN {
10482 panic!(
10483 "buffer is too small (need {} bytes, but got {})",
10484 Self::ENCODED_LEN,
10485 __tmp.remaining(),
10486 )
10487 }
10488 __tmp.put_u32_le(self.size);
10489 __tmp.put_u16_le(self.width);
10490 __tmp.put_u16_le(self.height);
10491 __tmp.put_u16_le(self.packets);
10492 __tmp.put_u8(self.mavtype as u8);
10493 __tmp.put_u8(self.payload);
10494 __tmp.put_u8(self.jpg_quality);
10495 if matches!(version, MavlinkVersion::V2) {
10496 let len = __tmp.len();
10497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10498 } else {
10499 __tmp.len()
10500 }
10501 }
10502}
10503#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10504#[doc = ""]
10505#[doc = "ID: 254"]
10506#[derive(Debug, Clone, PartialEq)]
10507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10509#[cfg_attr(feature = "ts", derive(TS))]
10510#[cfg_attr(feature = "ts", ts(export))]
10511pub struct DEBUG_DATA {
10512 #[doc = "Timestamp (time since system boot)."]
10513 pub time_boot_ms: u32,
10514 #[doc = "DEBUG value"]
10515 pub value: f32,
10516 #[doc = "index of debug variable"]
10517 pub ind: u8,
10518}
10519impl DEBUG_DATA {
10520 pub const ENCODED_LEN: usize = 9usize;
10521 pub const DEFAULT: Self = Self {
10522 time_boot_ms: 0_u32,
10523 value: 0.0_f32,
10524 ind: 0_u8,
10525 };
10526 #[cfg(feature = "arbitrary")]
10527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10528 use arbitrary::{Arbitrary, Unstructured};
10529 let mut buf = [0u8; 1024];
10530 rng.fill_bytes(&mut buf);
10531 let mut unstructured = Unstructured::new(&buf);
10532 Self::arbitrary(&mut unstructured).unwrap_or_default()
10533 }
10534}
10535impl Default for DEBUG_DATA {
10536 fn default() -> Self {
10537 Self::DEFAULT.clone()
10538 }
10539}
10540impl MessageData for DEBUG_DATA {
10541 type Message = MavMessage;
10542 const ID: u32 = 254u32;
10543 const NAME: &'static str = "DEBUG";
10544 const EXTRA_CRC: u8 = 46u8;
10545 const ENCODED_LEN: usize = 9usize;
10546 fn deser(
10547 _version: MavlinkVersion,
10548 __input: &[u8],
10549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10550 let avail_len = __input.len();
10551 let mut payload_buf = [0; Self::ENCODED_LEN];
10552 let mut buf = if avail_len < Self::ENCODED_LEN {
10553 payload_buf[0..avail_len].copy_from_slice(__input);
10554 Bytes::new(&payload_buf)
10555 } else {
10556 Bytes::new(__input)
10557 };
10558 let mut __struct = Self::default();
10559 __struct.time_boot_ms = buf.get_u32_le()?;
10560 __struct.value = buf.get_f32_le()?;
10561 __struct.ind = buf.get_u8()?;
10562 Ok(__struct)
10563 }
10564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10565 let mut __tmp = BytesMut::new(bytes);
10566 #[allow(clippy::absurd_extreme_comparisons)]
10567 #[allow(unused_comparisons)]
10568 if __tmp.remaining() < Self::ENCODED_LEN {
10569 panic!(
10570 "buffer is too small (need {} bytes, but got {})",
10571 Self::ENCODED_LEN,
10572 __tmp.remaining(),
10573 )
10574 }
10575 __tmp.put_u32_le(self.time_boot_ms);
10576 __tmp.put_f32_le(self.value);
10577 __tmp.put_u8(self.ind);
10578 if matches!(version, MavlinkVersion::V2) {
10579 let len = __tmp.len();
10580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10581 } else {
10582 __tmp.len()
10583 }
10584 }
10585}
10586#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10587#[doc = ""]
10588#[doc = "ID: 350"]
10589#[derive(Debug, Clone, PartialEq)]
10590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10592#[cfg_attr(feature = "ts", derive(TS))]
10593#[cfg_attr(feature = "ts", ts(export))]
10594pub struct DEBUG_FLOAT_ARRAY_DATA {
10595 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10596 pub time_usec: u64,
10597 #[doc = "Unique ID used to discriminate between arrays"]
10598 pub array_id: u16,
10599 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10600 #[cfg_attr(feature = "ts", ts(type = "string"))]
10601 pub name: CharArray<10>,
10602 #[doc = "data"]
10603 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10604 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10605 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10606 pub data: [f32; 58],
10607}
10608impl DEBUG_FLOAT_ARRAY_DATA {
10609 pub const ENCODED_LEN: usize = 252usize;
10610 pub const DEFAULT: Self = Self {
10611 time_usec: 0_u64,
10612 array_id: 0_u16,
10613 name: CharArray::new([0_u8; 10usize]),
10614 data: [0.0_f32; 58usize],
10615 };
10616 #[cfg(feature = "arbitrary")]
10617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10618 use arbitrary::{Arbitrary, Unstructured};
10619 let mut buf = [0u8; 1024];
10620 rng.fill_bytes(&mut buf);
10621 let mut unstructured = Unstructured::new(&buf);
10622 Self::arbitrary(&mut unstructured).unwrap_or_default()
10623 }
10624}
10625impl Default for DEBUG_FLOAT_ARRAY_DATA {
10626 fn default() -> Self {
10627 Self::DEFAULT.clone()
10628 }
10629}
10630impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10631 type Message = MavMessage;
10632 const ID: u32 = 350u32;
10633 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10634 const EXTRA_CRC: u8 = 232u8;
10635 const ENCODED_LEN: usize = 252usize;
10636 fn deser(
10637 _version: MavlinkVersion,
10638 __input: &[u8],
10639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10640 let avail_len = __input.len();
10641 let mut payload_buf = [0; Self::ENCODED_LEN];
10642 let mut buf = if avail_len < Self::ENCODED_LEN {
10643 payload_buf[0..avail_len].copy_from_slice(__input);
10644 Bytes::new(&payload_buf)
10645 } else {
10646 Bytes::new(__input)
10647 };
10648 let mut __struct = Self::default();
10649 __struct.time_usec = buf.get_u64_le()?;
10650 __struct.array_id = buf.get_u16_le()?;
10651 let mut tmp = [0_u8; 10usize];
10652 for v in &mut tmp {
10653 *v = buf.get_u8()?;
10654 }
10655 __struct.name = CharArray::new(tmp);
10656 for v in &mut __struct.data {
10657 let val = buf.get_f32_le()?;
10658 *v = val;
10659 }
10660 Ok(__struct)
10661 }
10662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10663 let mut __tmp = BytesMut::new(bytes);
10664 #[allow(clippy::absurd_extreme_comparisons)]
10665 #[allow(unused_comparisons)]
10666 if __tmp.remaining() < Self::ENCODED_LEN {
10667 panic!(
10668 "buffer is too small (need {} bytes, but got {})",
10669 Self::ENCODED_LEN,
10670 __tmp.remaining(),
10671 )
10672 }
10673 __tmp.put_u64_le(self.time_usec);
10674 __tmp.put_u16_le(self.array_id);
10675 for val in &self.name {
10676 __tmp.put_u8(*val);
10677 }
10678 if matches!(version, MavlinkVersion::V2) {
10679 for val in &self.data {
10680 __tmp.put_f32_le(*val);
10681 }
10682 let len = __tmp.len();
10683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10684 } else {
10685 __tmp.len()
10686 }
10687 }
10688}
10689#[doc = "To debug something using a named 3D vector."]
10690#[doc = ""]
10691#[doc = "ID: 250"]
10692#[derive(Debug, Clone, PartialEq)]
10693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10695#[cfg_attr(feature = "ts", derive(TS))]
10696#[cfg_attr(feature = "ts", ts(export))]
10697pub struct DEBUG_VECT_DATA {
10698 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10699 pub time_usec: u64,
10700 #[doc = "x"]
10701 pub x: f32,
10702 #[doc = "y"]
10703 pub y: f32,
10704 #[doc = "z"]
10705 pub z: f32,
10706 #[doc = "Name"]
10707 #[cfg_attr(feature = "ts", ts(type = "string"))]
10708 pub name: CharArray<10>,
10709}
10710impl DEBUG_VECT_DATA {
10711 pub const ENCODED_LEN: usize = 30usize;
10712 pub const DEFAULT: Self = Self {
10713 time_usec: 0_u64,
10714 x: 0.0_f32,
10715 y: 0.0_f32,
10716 z: 0.0_f32,
10717 name: CharArray::new([0_u8; 10usize]),
10718 };
10719 #[cfg(feature = "arbitrary")]
10720 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10721 use arbitrary::{Arbitrary, Unstructured};
10722 let mut buf = [0u8; 1024];
10723 rng.fill_bytes(&mut buf);
10724 let mut unstructured = Unstructured::new(&buf);
10725 Self::arbitrary(&mut unstructured).unwrap_or_default()
10726 }
10727}
10728impl Default for DEBUG_VECT_DATA {
10729 fn default() -> Self {
10730 Self::DEFAULT.clone()
10731 }
10732}
10733impl MessageData for DEBUG_VECT_DATA {
10734 type Message = MavMessage;
10735 const ID: u32 = 250u32;
10736 const NAME: &'static str = "DEBUG_VECT";
10737 const EXTRA_CRC: u8 = 49u8;
10738 const ENCODED_LEN: usize = 30usize;
10739 fn deser(
10740 _version: MavlinkVersion,
10741 __input: &[u8],
10742 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10743 let avail_len = __input.len();
10744 let mut payload_buf = [0; Self::ENCODED_LEN];
10745 let mut buf = if avail_len < Self::ENCODED_LEN {
10746 payload_buf[0..avail_len].copy_from_slice(__input);
10747 Bytes::new(&payload_buf)
10748 } else {
10749 Bytes::new(__input)
10750 };
10751 let mut __struct = Self::default();
10752 __struct.time_usec = buf.get_u64_le()?;
10753 __struct.x = buf.get_f32_le()?;
10754 __struct.y = buf.get_f32_le()?;
10755 __struct.z = buf.get_f32_le()?;
10756 let mut tmp = [0_u8; 10usize];
10757 for v in &mut tmp {
10758 *v = buf.get_u8()?;
10759 }
10760 __struct.name = CharArray::new(tmp);
10761 Ok(__struct)
10762 }
10763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10764 let mut __tmp = BytesMut::new(bytes);
10765 #[allow(clippy::absurd_extreme_comparisons)]
10766 #[allow(unused_comparisons)]
10767 if __tmp.remaining() < Self::ENCODED_LEN {
10768 panic!(
10769 "buffer is too small (need {} bytes, but got {})",
10770 Self::ENCODED_LEN,
10771 __tmp.remaining(),
10772 )
10773 }
10774 __tmp.put_u64_le(self.time_usec);
10775 __tmp.put_f32_le(self.x);
10776 __tmp.put_f32_le(self.y);
10777 __tmp.put_f32_le(self.z);
10778 for val in &self.name {
10779 __tmp.put_u8(*val);
10780 }
10781 if matches!(version, MavlinkVersion::V2) {
10782 let len = __tmp.len();
10783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10784 } else {
10785 __tmp.len()
10786 }
10787 }
10788}
10789#[doc = "Distance sensor information for an onboard rangefinder."]
10790#[doc = ""]
10791#[doc = "ID: 132"]
10792#[derive(Debug, Clone, PartialEq)]
10793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10795#[cfg_attr(feature = "ts", derive(TS))]
10796#[cfg_attr(feature = "ts", ts(export))]
10797pub struct DISTANCE_SENSOR_DATA {
10798 #[doc = "Timestamp (time since system boot)."]
10799 pub time_boot_ms: u32,
10800 #[doc = "Minimum distance the sensor can measure"]
10801 pub min_distance: u16,
10802 #[doc = "Maximum distance the sensor can measure"]
10803 pub max_distance: u16,
10804 #[doc = "Current distance reading"]
10805 pub current_distance: u16,
10806 #[doc = "Type of distance sensor."]
10807 pub mavtype: MavDistanceSensor,
10808 #[doc = "Onboard ID of the sensor"]
10809 pub id: u8,
10810 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10811 pub orientation: MavSensorOrientation,
10812 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10813 pub covariance: u8,
10814 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10815 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10816 pub horizontal_fov: f32,
10817 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10819 pub vertical_fov: f32,
10820 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10822 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10823 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10824 pub quaternion: [f32; 4],
10825 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10827 pub signal_quality: u8,
10828}
10829impl DISTANCE_SENSOR_DATA {
10830 pub const ENCODED_LEN: usize = 39usize;
10831 pub const DEFAULT: Self = Self {
10832 time_boot_ms: 0_u32,
10833 min_distance: 0_u16,
10834 max_distance: 0_u16,
10835 current_distance: 0_u16,
10836 mavtype: MavDistanceSensor::DEFAULT,
10837 id: 0_u8,
10838 orientation: MavSensorOrientation::DEFAULT,
10839 covariance: 0_u8,
10840 horizontal_fov: 0.0_f32,
10841 vertical_fov: 0.0_f32,
10842 quaternion: [0.0_f32; 4usize],
10843 signal_quality: 0_u8,
10844 };
10845 #[cfg(feature = "arbitrary")]
10846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10847 use arbitrary::{Arbitrary, Unstructured};
10848 let mut buf = [0u8; 1024];
10849 rng.fill_bytes(&mut buf);
10850 let mut unstructured = Unstructured::new(&buf);
10851 Self::arbitrary(&mut unstructured).unwrap_or_default()
10852 }
10853}
10854impl Default for DISTANCE_SENSOR_DATA {
10855 fn default() -> Self {
10856 Self::DEFAULT.clone()
10857 }
10858}
10859impl MessageData for DISTANCE_SENSOR_DATA {
10860 type Message = MavMessage;
10861 const ID: u32 = 132u32;
10862 const NAME: &'static str = "DISTANCE_SENSOR";
10863 const EXTRA_CRC: u8 = 85u8;
10864 const ENCODED_LEN: usize = 39usize;
10865 fn deser(
10866 _version: MavlinkVersion,
10867 __input: &[u8],
10868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10869 let avail_len = __input.len();
10870 let mut payload_buf = [0; Self::ENCODED_LEN];
10871 let mut buf = if avail_len < Self::ENCODED_LEN {
10872 payload_buf[0..avail_len].copy_from_slice(__input);
10873 Bytes::new(&payload_buf)
10874 } else {
10875 Bytes::new(__input)
10876 };
10877 let mut __struct = Self::default();
10878 __struct.time_boot_ms = buf.get_u32_le()?;
10879 __struct.min_distance = buf.get_u16_le()?;
10880 __struct.max_distance = buf.get_u16_le()?;
10881 __struct.current_distance = buf.get_u16_le()?;
10882 let tmp = buf.get_u8()?;
10883 __struct.mavtype =
10884 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10885 enum_type: "MavDistanceSensor",
10886 value: tmp as u64,
10887 })?;
10888 __struct.id = buf.get_u8()?;
10889 let tmp = buf.get_u8()?;
10890 __struct.orientation =
10891 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10892 enum_type: "MavSensorOrientation",
10893 value: tmp as u64,
10894 })?;
10895 __struct.covariance = buf.get_u8()?;
10896 __struct.horizontal_fov = buf.get_f32_le()?;
10897 __struct.vertical_fov = buf.get_f32_le()?;
10898 for v in &mut __struct.quaternion {
10899 let val = buf.get_f32_le()?;
10900 *v = val;
10901 }
10902 __struct.signal_quality = buf.get_u8()?;
10903 Ok(__struct)
10904 }
10905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10906 let mut __tmp = BytesMut::new(bytes);
10907 #[allow(clippy::absurd_extreme_comparisons)]
10908 #[allow(unused_comparisons)]
10909 if __tmp.remaining() < Self::ENCODED_LEN {
10910 panic!(
10911 "buffer is too small (need {} bytes, but got {})",
10912 Self::ENCODED_LEN,
10913 __tmp.remaining(),
10914 )
10915 }
10916 __tmp.put_u32_le(self.time_boot_ms);
10917 __tmp.put_u16_le(self.min_distance);
10918 __tmp.put_u16_le(self.max_distance);
10919 __tmp.put_u16_le(self.current_distance);
10920 __tmp.put_u8(self.mavtype as u8);
10921 __tmp.put_u8(self.id);
10922 __tmp.put_u8(self.orientation as u8);
10923 __tmp.put_u8(self.covariance);
10924 if matches!(version, MavlinkVersion::V2) {
10925 __tmp.put_f32_le(self.horizontal_fov);
10926 __tmp.put_f32_le(self.vertical_fov);
10927 for val in &self.quaternion {
10928 __tmp.put_f32_le(*val);
10929 }
10930 __tmp.put_u8(self.signal_quality);
10931 let len = __tmp.len();
10932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10933 } else {
10934 __tmp.len()
10935 }
10936 }
10937}
10938#[doc = "EFI status output."]
10939#[doc = ""]
10940#[doc = "ID: 225"]
10941#[derive(Debug, Clone, PartialEq)]
10942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10944#[cfg_attr(feature = "ts", derive(TS))]
10945#[cfg_attr(feature = "ts", ts(export))]
10946pub struct EFI_STATUS_DATA {
10947 #[doc = "ECU index"]
10948 pub ecu_index: f32,
10949 #[doc = "RPM"]
10950 pub rpm: f32,
10951 #[doc = "Fuel consumed"]
10952 pub fuel_consumed: f32,
10953 #[doc = "Fuel flow rate"]
10954 pub fuel_flow: f32,
10955 #[doc = "Engine load"]
10956 pub engine_load: f32,
10957 #[doc = "Throttle position"]
10958 pub throttle_position: f32,
10959 #[doc = "Spark dwell time"]
10960 pub spark_dwell_time: f32,
10961 #[doc = "Barometric pressure"]
10962 pub barometric_pressure: f32,
10963 #[doc = "Intake manifold pressure("]
10964 pub intake_manifold_pressure: f32,
10965 #[doc = "Intake manifold temperature"]
10966 pub intake_manifold_temperature: f32,
10967 #[doc = "Cylinder head temperature"]
10968 pub cylinder_head_temperature: f32,
10969 #[doc = "Ignition timing (Crank angle degrees)"]
10970 pub ignition_timing: f32,
10971 #[doc = "Injection time"]
10972 pub injection_time: f32,
10973 #[doc = "Exhaust gas temperature"]
10974 pub exhaust_gas_temperature: f32,
10975 #[doc = "Output throttle"]
10976 pub throttle_out: f32,
10977 #[doc = "Pressure/temperature compensation"]
10978 pub pt_compensation: f32,
10979 #[doc = "EFI health status"]
10980 pub health: u8,
10981 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10983 pub ignition_voltage: f32,
10984 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10985 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10986 pub fuel_pressure: f32,
10987}
10988impl EFI_STATUS_DATA {
10989 pub const ENCODED_LEN: usize = 73usize;
10990 pub const DEFAULT: Self = Self {
10991 ecu_index: 0.0_f32,
10992 rpm: 0.0_f32,
10993 fuel_consumed: 0.0_f32,
10994 fuel_flow: 0.0_f32,
10995 engine_load: 0.0_f32,
10996 throttle_position: 0.0_f32,
10997 spark_dwell_time: 0.0_f32,
10998 barometric_pressure: 0.0_f32,
10999 intake_manifold_pressure: 0.0_f32,
11000 intake_manifold_temperature: 0.0_f32,
11001 cylinder_head_temperature: 0.0_f32,
11002 ignition_timing: 0.0_f32,
11003 injection_time: 0.0_f32,
11004 exhaust_gas_temperature: 0.0_f32,
11005 throttle_out: 0.0_f32,
11006 pt_compensation: 0.0_f32,
11007 health: 0_u8,
11008 ignition_voltage: 0.0_f32,
11009 fuel_pressure: 0.0_f32,
11010 };
11011 #[cfg(feature = "arbitrary")]
11012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11013 use arbitrary::{Arbitrary, Unstructured};
11014 let mut buf = [0u8; 1024];
11015 rng.fill_bytes(&mut buf);
11016 let mut unstructured = Unstructured::new(&buf);
11017 Self::arbitrary(&mut unstructured).unwrap_or_default()
11018 }
11019}
11020impl Default for EFI_STATUS_DATA {
11021 fn default() -> Self {
11022 Self::DEFAULT.clone()
11023 }
11024}
11025impl MessageData for EFI_STATUS_DATA {
11026 type Message = MavMessage;
11027 const ID: u32 = 225u32;
11028 const NAME: &'static str = "EFI_STATUS";
11029 const EXTRA_CRC: u8 = 208u8;
11030 const ENCODED_LEN: usize = 73usize;
11031 fn deser(
11032 _version: MavlinkVersion,
11033 __input: &[u8],
11034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11035 let avail_len = __input.len();
11036 let mut payload_buf = [0; Self::ENCODED_LEN];
11037 let mut buf = if avail_len < Self::ENCODED_LEN {
11038 payload_buf[0..avail_len].copy_from_slice(__input);
11039 Bytes::new(&payload_buf)
11040 } else {
11041 Bytes::new(__input)
11042 };
11043 let mut __struct = Self::default();
11044 __struct.ecu_index = buf.get_f32_le()?;
11045 __struct.rpm = buf.get_f32_le()?;
11046 __struct.fuel_consumed = buf.get_f32_le()?;
11047 __struct.fuel_flow = buf.get_f32_le()?;
11048 __struct.engine_load = buf.get_f32_le()?;
11049 __struct.throttle_position = buf.get_f32_le()?;
11050 __struct.spark_dwell_time = buf.get_f32_le()?;
11051 __struct.barometric_pressure = buf.get_f32_le()?;
11052 __struct.intake_manifold_pressure = buf.get_f32_le()?;
11053 __struct.intake_manifold_temperature = buf.get_f32_le()?;
11054 __struct.cylinder_head_temperature = buf.get_f32_le()?;
11055 __struct.ignition_timing = buf.get_f32_le()?;
11056 __struct.injection_time = buf.get_f32_le()?;
11057 __struct.exhaust_gas_temperature = buf.get_f32_le()?;
11058 __struct.throttle_out = buf.get_f32_le()?;
11059 __struct.pt_compensation = buf.get_f32_le()?;
11060 __struct.health = buf.get_u8()?;
11061 __struct.ignition_voltage = buf.get_f32_le()?;
11062 __struct.fuel_pressure = buf.get_f32_le()?;
11063 Ok(__struct)
11064 }
11065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11066 let mut __tmp = BytesMut::new(bytes);
11067 #[allow(clippy::absurd_extreme_comparisons)]
11068 #[allow(unused_comparisons)]
11069 if __tmp.remaining() < Self::ENCODED_LEN {
11070 panic!(
11071 "buffer is too small (need {} bytes, but got {})",
11072 Self::ENCODED_LEN,
11073 __tmp.remaining(),
11074 )
11075 }
11076 __tmp.put_f32_le(self.ecu_index);
11077 __tmp.put_f32_le(self.rpm);
11078 __tmp.put_f32_le(self.fuel_consumed);
11079 __tmp.put_f32_le(self.fuel_flow);
11080 __tmp.put_f32_le(self.engine_load);
11081 __tmp.put_f32_le(self.throttle_position);
11082 __tmp.put_f32_le(self.spark_dwell_time);
11083 __tmp.put_f32_le(self.barometric_pressure);
11084 __tmp.put_f32_le(self.intake_manifold_pressure);
11085 __tmp.put_f32_le(self.intake_manifold_temperature);
11086 __tmp.put_f32_le(self.cylinder_head_temperature);
11087 __tmp.put_f32_le(self.ignition_timing);
11088 __tmp.put_f32_le(self.injection_time);
11089 __tmp.put_f32_le(self.exhaust_gas_temperature);
11090 __tmp.put_f32_le(self.throttle_out);
11091 __tmp.put_f32_le(self.pt_compensation);
11092 __tmp.put_u8(self.health);
11093 if matches!(version, MavlinkVersion::V2) {
11094 __tmp.put_f32_le(self.ignition_voltage);
11095 __tmp.put_f32_le(self.fuel_pressure);
11096 let len = __tmp.len();
11097 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11098 } else {
11099 __tmp.len()
11100 }
11101 }
11102}
11103#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11104#[doc = ""]
11105#[doc = "ID: 131"]
11106#[derive(Debug, Clone, PartialEq)]
11107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11109#[cfg_attr(feature = "ts", derive(TS))]
11110#[cfg_attr(feature = "ts", ts(export))]
11111pub struct ENCAPSULATED_DATA_DATA {
11112 #[doc = "sequence number (starting with 0 on every transmission)"]
11113 pub seqnr: u16,
11114 #[doc = "image data bytes"]
11115 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11116 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11117 pub data: [u8; 253],
11118}
11119impl ENCAPSULATED_DATA_DATA {
11120 pub const ENCODED_LEN: usize = 255usize;
11121 pub const DEFAULT: Self = Self {
11122 seqnr: 0_u16,
11123 data: [0_u8; 253usize],
11124 };
11125 #[cfg(feature = "arbitrary")]
11126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11127 use arbitrary::{Arbitrary, Unstructured};
11128 let mut buf = [0u8; 1024];
11129 rng.fill_bytes(&mut buf);
11130 let mut unstructured = Unstructured::new(&buf);
11131 Self::arbitrary(&mut unstructured).unwrap_or_default()
11132 }
11133}
11134impl Default for ENCAPSULATED_DATA_DATA {
11135 fn default() -> Self {
11136 Self::DEFAULT.clone()
11137 }
11138}
11139impl MessageData for ENCAPSULATED_DATA_DATA {
11140 type Message = MavMessage;
11141 const ID: u32 = 131u32;
11142 const NAME: &'static str = "ENCAPSULATED_DATA";
11143 const EXTRA_CRC: u8 = 223u8;
11144 const ENCODED_LEN: usize = 255usize;
11145 fn deser(
11146 _version: MavlinkVersion,
11147 __input: &[u8],
11148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11149 let avail_len = __input.len();
11150 let mut payload_buf = [0; Self::ENCODED_LEN];
11151 let mut buf = if avail_len < Self::ENCODED_LEN {
11152 payload_buf[0..avail_len].copy_from_slice(__input);
11153 Bytes::new(&payload_buf)
11154 } else {
11155 Bytes::new(__input)
11156 };
11157 let mut __struct = Self::default();
11158 __struct.seqnr = buf.get_u16_le()?;
11159 for v in &mut __struct.data {
11160 let val = buf.get_u8()?;
11161 *v = val;
11162 }
11163 Ok(__struct)
11164 }
11165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11166 let mut __tmp = BytesMut::new(bytes);
11167 #[allow(clippy::absurd_extreme_comparisons)]
11168 #[allow(unused_comparisons)]
11169 if __tmp.remaining() < Self::ENCODED_LEN {
11170 panic!(
11171 "buffer is too small (need {} bytes, but got {})",
11172 Self::ENCODED_LEN,
11173 __tmp.remaining(),
11174 )
11175 }
11176 __tmp.put_u16_le(self.seqnr);
11177 for val in &self.data {
11178 __tmp.put_u8(*val);
11179 }
11180 if matches!(version, MavlinkVersion::V2) {
11181 let len = __tmp.len();
11182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11183 } else {
11184 __tmp.len()
11185 }
11186 }
11187}
11188#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11189#[doc = ""]
11190#[doc = "ID: 290"]
11191#[derive(Debug, Clone, PartialEq)]
11192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11194#[cfg_attr(feature = "ts", derive(TS))]
11195#[cfg_attr(feature = "ts", ts(export))]
11196pub struct ESC_INFO_DATA {
11197 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11198 pub time_usec: u64,
11199 #[doc = "Number of reported errors by each ESC since boot."]
11200 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11201 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11202 pub error_count: [u32; 4],
11203 #[doc = "Counter of data packets received."]
11204 pub counter: u16,
11205 #[doc = "Bitmap of ESC failure flags."]
11206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11207 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11208 pub failure_flags: [u16; 4],
11209 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11211 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11212 pub temperature: [i16; 4],
11213 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11214 pub index: u8,
11215 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11216 pub count: u8,
11217 #[doc = "Connection type protocol for all ESC."]
11218 pub connection_type: EscConnectionType,
11219 #[doc = "Information regarding online/offline status of each ESC."]
11220 pub info: u8,
11221}
11222impl ESC_INFO_DATA {
11223 pub const ENCODED_LEN: usize = 46usize;
11224 pub const DEFAULT: Self = Self {
11225 time_usec: 0_u64,
11226 error_count: [0_u32; 4usize],
11227 counter: 0_u16,
11228 failure_flags: [0_u16; 4usize],
11229 temperature: [0_i16; 4usize],
11230 index: 0_u8,
11231 count: 0_u8,
11232 connection_type: EscConnectionType::DEFAULT,
11233 info: 0_u8,
11234 };
11235 #[cfg(feature = "arbitrary")]
11236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11237 use arbitrary::{Arbitrary, Unstructured};
11238 let mut buf = [0u8; 1024];
11239 rng.fill_bytes(&mut buf);
11240 let mut unstructured = Unstructured::new(&buf);
11241 Self::arbitrary(&mut unstructured).unwrap_or_default()
11242 }
11243}
11244impl Default for ESC_INFO_DATA {
11245 fn default() -> Self {
11246 Self::DEFAULT.clone()
11247 }
11248}
11249impl MessageData for ESC_INFO_DATA {
11250 type Message = MavMessage;
11251 const ID: u32 = 290u32;
11252 const NAME: &'static str = "ESC_INFO";
11253 const EXTRA_CRC: u8 = 251u8;
11254 const ENCODED_LEN: usize = 46usize;
11255 fn deser(
11256 _version: MavlinkVersion,
11257 __input: &[u8],
11258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11259 let avail_len = __input.len();
11260 let mut payload_buf = [0; Self::ENCODED_LEN];
11261 let mut buf = if avail_len < Self::ENCODED_LEN {
11262 payload_buf[0..avail_len].copy_from_slice(__input);
11263 Bytes::new(&payload_buf)
11264 } else {
11265 Bytes::new(__input)
11266 };
11267 let mut __struct = Self::default();
11268 __struct.time_usec = buf.get_u64_le()?;
11269 for v in &mut __struct.error_count {
11270 let val = buf.get_u32_le()?;
11271 *v = val;
11272 }
11273 __struct.counter = buf.get_u16_le()?;
11274 for v in &mut __struct.failure_flags {
11275 let val = buf.get_u16_le()?;
11276 *v = val;
11277 }
11278 for v in &mut __struct.temperature {
11279 let val = buf.get_i16_le()?;
11280 *v = val;
11281 }
11282 __struct.index = buf.get_u8()?;
11283 __struct.count = buf.get_u8()?;
11284 let tmp = buf.get_u8()?;
11285 __struct.connection_type =
11286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11287 enum_type: "EscConnectionType",
11288 value: tmp as u64,
11289 })?;
11290 __struct.info = buf.get_u8()?;
11291 Ok(__struct)
11292 }
11293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11294 let mut __tmp = BytesMut::new(bytes);
11295 #[allow(clippy::absurd_extreme_comparisons)]
11296 #[allow(unused_comparisons)]
11297 if __tmp.remaining() < Self::ENCODED_LEN {
11298 panic!(
11299 "buffer is too small (need {} bytes, but got {})",
11300 Self::ENCODED_LEN,
11301 __tmp.remaining(),
11302 )
11303 }
11304 __tmp.put_u64_le(self.time_usec);
11305 for val in &self.error_count {
11306 __tmp.put_u32_le(*val);
11307 }
11308 __tmp.put_u16_le(self.counter);
11309 for val in &self.failure_flags {
11310 __tmp.put_u16_le(*val);
11311 }
11312 for val in &self.temperature {
11313 __tmp.put_i16_le(*val);
11314 }
11315 __tmp.put_u8(self.index);
11316 __tmp.put_u8(self.count);
11317 __tmp.put_u8(self.connection_type as u8);
11318 __tmp.put_u8(self.info);
11319 if matches!(version, MavlinkVersion::V2) {
11320 let len = __tmp.len();
11321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11322 } else {
11323 __tmp.len()
11324 }
11325 }
11326}
11327#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11328#[doc = ""]
11329#[doc = "ID: 291"]
11330#[derive(Debug, Clone, PartialEq)]
11331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11333#[cfg_attr(feature = "ts", derive(TS))]
11334#[cfg_attr(feature = "ts", ts(export))]
11335pub struct ESC_STATUS_DATA {
11336 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11337 pub time_usec: u64,
11338 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11339 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11340 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11341 pub rpm: [i32; 4],
11342 #[doc = "Voltage measured from each ESC."]
11343 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11344 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11345 pub voltage: [f32; 4],
11346 #[doc = "Current measured from each ESC."]
11347 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11348 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11349 pub current: [f32; 4],
11350 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11351 pub index: u8,
11352}
11353impl ESC_STATUS_DATA {
11354 pub const ENCODED_LEN: usize = 57usize;
11355 pub const DEFAULT: Self = Self {
11356 time_usec: 0_u64,
11357 rpm: [0_i32; 4usize],
11358 voltage: [0.0_f32; 4usize],
11359 current: [0.0_f32; 4usize],
11360 index: 0_u8,
11361 };
11362 #[cfg(feature = "arbitrary")]
11363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11364 use arbitrary::{Arbitrary, Unstructured};
11365 let mut buf = [0u8; 1024];
11366 rng.fill_bytes(&mut buf);
11367 let mut unstructured = Unstructured::new(&buf);
11368 Self::arbitrary(&mut unstructured).unwrap_or_default()
11369 }
11370}
11371impl Default for ESC_STATUS_DATA {
11372 fn default() -> Self {
11373 Self::DEFAULT.clone()
11374 }
11375}
11376impl MessageData for ESC_STATUS_DATA {
11377 type Message = MavMessage;
11378 const ID: u32 = 291u32;
11379 const NAME: &'static str = "ESC_STATUS";
11380 const EXTRA_CRC: u8 = 10u8;
11381 const ENCODED_LEN: usize = 57usize;
11382 fn deser(
11383 _version: MavlinkVersion,
11384 __input: &[u8],
11385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11386 let avail_len = __input.len();
11387 let mut payload_buf = [0; Self::ENCODED_LEN];
11388 let mut buf = if avail_len < Self::ENCODED_LEN {
11389 payload_buf[0..avail_len].copy_from_slice(__input);
11390 Bytes::new(&payload_buf)
11391 } else {
11392 Bytes::new(__input)
11393 };
11394 let mut __struct = Self::default();
11395 __struct.time_usec = buf.get_u64_le()?;
11396 for v in &mut __struct.rpm {
11397 let val = buf.get_i32_le()?;
11398 *v = val;
11399 }
11400 for v in &mut __struct.voltage {
11401 let val = buf.get_f32_le()?;
11402 *v = val;
11403 }
11404 for v in &mut __struct.current {
11405 let val = buf.get_f32_le()?;
11406 *v = val;
11407 }
11408 __struct.index = buf.get_u8()?;
11409 Ok(__struct)
11410 }
11411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11412 let mut __tmp = BytesMut::new(bytes);
11413 #[allow(clippy::absurd_extreme_comparisons)]
11414 #[allow(unused_comparisons)]
11415 if __tmp.remaining() < Self::ENCODED_LEN {
11416 panic!(
11417 "buffer is too small (need {} bytes, but got {})",
11418 Self::ENCODED_LEN,
11419 __tmp.remaining(),
11420 )
11421 }
11422 __tmp.put_u64_le(self.time_usec);
11423 for val in &self.rpm {
11424 __tmp.put_i32_le(*val);
11425 }
11426 for val in &self.voltage {
11427 __tmp.put_f32_le(*val);
11428 }
11429 for val in &self.current {
11430 __tmp.put_f32_le(*val);
11431 }
11432 __tmp.put_u8(self.index);
11433 if matches!(version, MavlinkVersion::V2) {
11434 let len = __tmp.len();
11435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11436 } else {
11437 __tmp.len()
11438 }
11439 }
11440}
11441#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11442#[doc = ""]
11443#[doc = "ID: 230"]
11444#[derive(Debug, Clone, PartialEq)]
11445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11447#[cfg_attr(feature = "ts", derive(TS))]
11448#[cfg_attr(feature = "ts", ts(export))]
11449pub struct ESTIMATOR_STATUS_DATA {
11450 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11451 pub time_usec: u64,
11452 #[doc = "Velocity innovation test ratio"]
11453 pub vel_ratio: f32,
11454 #[doc = "Horizontal position innovation test ratio"]
11455 pub pos_horiz_ratio: f32,
11456 #[doc = "Vertical position innovation test ratio"]
11457 pub pos_vert_ratio: f32,
11458 #[doc = "Magnetometer innovation test ratio"]
11459 pub mag_ratio: f32,
11460 #[doc = "Height above terrain innovation test ratio"]
11461 pub hagl_ratio: f32,
11462 #[doc = "True airspeed innovation test ratio"]
11463 pub tas_ratio: f32,
11464 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11465 pub pos_horiz_accuracy: f32,
11466 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11467 pub pos_vert_accuracy: f32,
11468 #[doc = "Bitmap indicating which EKF outputs are valid."]
11469 pub flags: EstimatorStatusFlags,
11470}
11471impl ESTIMATOR_STATUS_DATA {
11472 pub const ENCODED_LEN: usize = 42usize;
11473 pub const DEFAULT: Self = Self {
11474 time_usec: 0_u64,
11475 vel_ratio: 0.0_f32,
11476 pos_horiz_ratio: 0.0_f32,
11477 pos_vert_ratio: 0.0_f32,
11478 mag_ratio: 0.0_f32,
11479 hagl_ratio: 0.0_f32,
11480 tas_ratio: 0.0_f32,
11481 pos_horiz_accuracy: 0.0_f32,
11482 pos_vert_accuracy: 0.0_f32,
11483 flags: EstimatorStatusFlags::DEFAULT,
11484 };
11485 #[cfg(feature = "arbitrary")]
11486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11487 use arbitrary::{Arbitrary, Unstructured};
11488 let mut buf = [0u8; 1024];
11489 rng.fill_bytes(&mut buf);
11490 let mut unstructured = Unstructured::new(&buf);
11491 Self::arbitrary(&mut unstructured).unwrap_or_default()
11492 }
11493}
11494impl Default for ESTIMATOR_STATUS_DATA {
11495 fn default() -> Self {
11496 Self::DEFAULT.clone()
11497 }
11498}
11499impl MessageData for ESTIMATOR_STATUS_DATA {
11500 type Message = MavMessage;
11501 const ID: u32 = 230u32;
11502 const NAME: &'static str = "ESTIMATOR_STATUS";
11503 const EXTRA_CRC: u8 = 163u8;
11504 const ENCODED_LEN: usize = 42usize;
11505 fn deser(
11506 _version: MavlinkVersion,
11507 __input: &[u8],
11508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11509 let avail_len = __input.len();
11510 let mut payload_buf = [0; Self::ENCODED_LEN];
11511 let mut buf = if avail_len < Self::ENCODED_LEN {
11512 payload_buf[0..avail_len].copy_from_slice(__input);
11513 Bytes::new(&payload_buf)
11514 } else {
11515 Bytes::new(__input)
11516 };
11517 let mut __struct = Self::default();
11518 __struct.time_usec = buf.get_u64_le()?;
11519 __struct.vel_ratio = buf.get_f32_le()?;
11520 __struct.pos_horiz_ratio = buf.get_f32_le()?;
11521 __struct.pos_vert_ratio = buf.get_f32_le()?;
11522 __struct.mag_ratio = buf.get_f32_le()?;
11523 __struct.hagl_ratio = buf.get_f32_le()?;
11524 __struct.tas_ratio = buf.get_f32_le()?;
11525 __struct.pos_horiz_accuracy = buf.get_f32_le()?;
11526 __struct.pos_vert_accuracy = buf.get_f32_le()?;
11527 let tmp = buf.get_u16_le()?;
11528 __struct.flags = EstimatorStatusFlags::from_bits(
11529 tmp as <EstimatorStatusFlags as Flags>::Bits,
11530 )
11531 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11532 flag_type: "EstimatorStatusFlags",
11533 value: tmp as u64,
11534 })?;
11535 Ok(__struct)
11536 }
11537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11538 let mut __tmp = BytesMut::new(bytes);
11539 #[allow(clippy::absurd_extreme_comparisons)]
11540 #[allow(unused_comparisons)]
11541 if __tmp.remaining() < Self::ENCODED_LEN {
11542 panic!(
11543 "buffer is too small (need {} bytes, but got {})",
11544 Self::ENCODED_LEN,
11545 __tmp.remaining(),
11546 )
11547 }
11548 __tmp.put_u64_le(self.time_usec);
11549 __tmp.put_f32_le(self.vel_ratio);
11550 __tmp.put_f32_le(self.pos_horiz_ratio);
11551 __tmp.put_f32_le(self.pos_vert_ratio);
11552 __tmp.put_f32_le(self.mag_ratio);
11553 __tmp.put_f32_le(self.hagl_ratio);
11554 __tmp.put_f32_le(self.tas_ratio);
11555 __tmp.put_f32_le(self.pos_horiz_accuracy);
11556 __tmp.put_f32_le(self.pos_vert_accuracy);
11557 __tmp.put_u16_le(self.flags.bits() as u16);
11558 if matches!(version, MavlinkVersion::V2) {
11559 let len = __tmp.len();
11560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11561 } else {
11562 __tmp.len()
11563 }
11564 }
11565}
11566#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11567#[doc = ""]
11568#[doc = "ID: 410"]
11569#[derive(Debug, Clone, PartialEq)]
11570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11572#[cfg_attr(feature = "ts", derive(TS))]
11573#[cfg_attr(feature = "ts", ts(export))]
11574pub struct EVENT_DATA {
11575 #[doc = "Event ID (as defined in the component metadata)"]
11576 pub id: u32,
11577 #[doc = "Timestamp (time since system boot when the event happened)."]
11578 pub event_time_boot_ms: u32,
11579 #[doc = "Sequence number."]
11580 pub sequence: u16,
11581 #[doc = "Component ID"]
11582 pub destination_component: u8,
11583 #[doc = "System ID"]
11584 pub destination_system: u8,
11585 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11586 pub log_levels: u8,
11587 #[doc = "Arguments (depend on event ID)."]
11588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11589 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11590 pub arguments: [u8; 40],
11591}
11592impl EVENT_DATA {
11593 pub const ENCODED_LEN: usize = 53usize;
11594 pub const DEFAULT: Self = Self {
11595 id: 0_u32,
11596 event_time_boot_ms: 0_u32,
11597 sequence: 0_u16,
11598 destination_component: 0_u8,
11599 destination_system: 0_u8,
11600 log_levels: 0_u8,
11601 arguments: [0_u8; 40usize],
11602 };
11603 #[cfg(feature = "arbitrary")]
11604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11605 use arbitrary::{Arbitrary, Unstructured};
11606 let mut buf = [0u8; 1024];
11607 rng.fill_bytes(&mut buf);
11608 let mut unstructured = Unstructured::new(&buf);
11609 Self::arbitrary(&mut unstructured).unwrap_or_default()
11610 }
11611}
11612impl Default for EVENT_DATA {
11613 fn default() -> Self {
11614 Self::DEFAULT.clone()
11615 }
11616}
11617impl MessageData for EVENT_DATA {
11618 type Message = MavMessage;
11619 const ID: u32 = 410u32;
11620 const NAME: &'static str = "EVENT";
11621 const EXTRA_CRC: u8 = 160u8;
11622 const ENCODED_LEN: usize = 53usize;
11623 fn deser(
11624 _version: MavlinkVersion,
11625 __input: &[u8],
11626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11627 let avail_len = __input.len();
11628 let mut payload_buf = [0; Self::ENCODED_LEN];
11629 let mut buf = if avail_len < Self::ENCODED_LEN {
11630 payload_buf[0..avail_len].copy_from_slice(__input);
11631 Bytes::new(&payload_buf)
11632 } else {
11633 Bytes::new(__input)
11634 };
11635 let mut __struct = Self::default();
11636 __struct.id = buf.get_u32_le()?;
11637 __struct.event_time_boot_ms = buf.get_u32_le()?;
11638 __struct.sequence = buf.get_u16_le()?;
11639 __struct.destination_component = buf.get_u8()?;
11640 __struct.destination_system = buf.get_u8()?;
11641 __struct.log_levels = buf.get_u8()?;
11642 for v in &mut __struct.arguments {
11643 let val = buf.get_u8()?;
11644 *v = val;
11645 }
11646 Ok(__struct)
11647 }
11648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11649 let mut __tmp = BytesMut::new(bytes);
11650 #[allow(clippy::absurd_extreme_comparisons)]
11651 #[allow(unused_comparisons)]
11652 if __tmp.remaining() < Self::ENCODED_LEN {
11653 panic!(
11654 "buffer is too small (need {} bytes, but got {})",
11655 Self::ENCODED_LEN,
11656 __tmp.remaining(),
11657 )
11658 }
11659 __tmp.put_u32_le(self.id);
11660 __tmp.put_u32_le(self.event_time_boot_ms);
11661 __tmp.put_u16_le(self.sequence);
11662 __tmp.put_u8(self.destination_component);
11663 __tmp.put_u8(self.destination_system);
11664 __tmp.put_u8(self.log_levels);
11665 for val in &self.arguments {
11666 __tmp.put_u8(*val);
11667 }
11668 if matches!(version, MavlinkVersion::V2) {
11669 let len = __tmp.len();
11670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11671 } else {
11672 __tmp.len()
11673 }
11674 }
11675}
11676#[doc = "Provides state for additional features."]
11677#[doc = ""]
11678#[doc = "ID: 245"]
11679#[derive(Debug, Clone, PartialEq)]
11680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11682#[cfg_attr(feature = "ts", derive(TS))]
11683#[cfg_attr(feature = "ts", ts(export))]
11684pub struct EXTENDED_SYS_STATE_DATA {
11685 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11686 pub vtol_state: MavVtolState,
11687 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11688 pub landed_state: MavLandedState,
11689}
11690impl EXTENDED_SYS_STATE_DATA {
11691 pub const ENCODED_LEN: usize = 2usize;
11692 pub const DEFAULT: Self = Self {
11693 vtol_state: MavVtolState::DEFAULT,
11694 landed_state: MavLandedState::DEFAULT,
11695 };
11696 #[cfg(feature = "arbitrary")]
11697 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11698 use arbitrary::{Arbitrary, Unstructured};
11699 let mut buf = [0u8; 1024];
11700 rng.fill_bytes(&mut buf);
11701 let mut unstructured = Unstructured::new(&buf);
11702 Self::arbitrary(&mut unstructured).unwrap_or_default()
11703 }
11704}
11705impl Default for EXTENDED_SYS_STATE_DATA {
11706 fn default() -> Self {
11707 Self::DEFAULT.clone()
11708 }
11709}
11710impl MessageData for EXTENDED_SYS_STATE_DATA {
11711 type Message = MavMessage;
11712 const ID: u32 = 245u32;
11713 const NAME: &'static str = "EXTENDED_SYS_STATE";
11714 const EXTRA_CRC: u8 = 130u8;
11715 const ENCODED_LEN: usize = 2usize;
11716 fn deser(
11717 _version: MavlinkVersion,
11718 __input: &[u8],
11719 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11720 let avail_len = __input.len();
11721 let mut payload_buf = [0; Self::ENCODED_LEN];
11722 let mut buf = if avail_len < Self::ENCODED_LEN {
11723 payload_buf[0..avail_len].copy_from_slice(__input);
11724 Bytes::new(&payload_buf)
11725 } else {
11726 Bytes::new(__input)
11727 };
11728 let mut __struct = Self::default();
11729 let tmp = buf.get_u8()?;
11730 __struct.vtol_state =
11731 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11732 enum_type: "MavVtolState",
11733 value: tmp as u64,
11734 })?;
11735 let tmp = buf.get_u8()?;
11736 __struct.landed_state =
11737 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11738 enum_type: "MavLandedState",
11739 value: tmp as u64,
11740 })?;
11741 Ok(__struct)
11742 }
11743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11744 let mut __tmp = BytesMut::new(bytes);
11745 #[allow(clippy::absurd_extreme_comparisons)]
11746 #[allow(unused_comparisons)]
11747 if __tmp.remaining() < Self::ENCODED_LEN {
11748 panic!(
11749 "buffer is too small (need {} bytes, but got {})",
11750 Self::ENCODED_LEN,
11751 __tmp.remaining(),
11752 )
11753 }
11754 __tmp.put_u8(self.vtol_state as u8);
11755 __tmp.put_u8(self.landed_state as u8);
11756 if matches!(version, MavlinkVersion::V2) {
11757 let len = __tmp.len();
11758 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11759 } else {
11760 __tmp.len()
11761 }
11762 }
11763}
11764#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11765#[doc = ""]
11766#[doc = "ID: 162"]
11767#[derive(Debug, Clone, PartialEq)]
11768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11770#[cfg_attr(feature = "ts", derive(TS))]
11771#[cfg_attr(feature = "ts", ts(export))]
11772pub struct FENCE_STATUS_DATA {
11773 #[doc = "Time (since boot) of last breach."]
11774 pub breach_time: u32,
11775 #[doc = "Number of fence breaches."]
11776 pub breach_count: u16,
11777 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11778 pub breach_status: u8,
11779 #[doc = "Last breach type."]
11780 pub breach_type: FenceBreach,
11781 #[doc = "Active action to prevent fence breach"]
11782 #[cfg_attr(feature = "serde", serde(default))]
11783 pub breach_mitigation: FenceMitigate,
11784}
11785impl FENCE_STATUS_DATA {
11786 pub const ENCODED_LEN: usize = 9usize;
11787 pub const DEFAULT: Self = Self {
11788 breach_time: 0_u32,
11789 breach_count: 0_u16,
11790 breach_status: 0_u8,
11791 breach_type: FenceBreach::DEFAULT,
11792 breach_mitigation: FenceMitigate::DEFAULT,
11793 };
11794 #[cfg(feature = "arbitrary")]
11795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11796 use arbitrary::{Arbitrary, Unstructured};
11797 let mut buf = [0u8; 1024];
11798 rng.fill_bytes(&mut buf);
11799 let mut unstructured = Unstructured::new(&buf);
11800 Self::arbitrary(&mut unstructured).unwrap_or_default()
11801 }
11802}
11803impl Default for FENCE_STATUS_DATA {
11804 fn default() -> Self {
11805 Self::DEFAULT.clone()
11806 }
11807}
11808impl MessageData for FENCE_STATUS_DATA {
11809 type Message = MavMessage;
11810 const ID: u32 = 162u32;
11811 const NAME: &'static str = "FENCE_STATUS";
11812 const EXTRA_CRC: u8 = 189u8;
11813 const ENCODED_LEN: usize = 9usize;
11814 fn deser(
11815 _version: MavlinkVersion,
11816 __input: &[u8],
11817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11818 let avail_len = __input.len();
11819 let mut payload_buf = [0; Self::ENCODED_LEN];
11820 let mut buf = if avail_len < Self::ENCODED_LEN {
11821 payload_buf[0..avail_len].copy_from_slice(__input);
11822 Bytes::new(&payload_buf)
11823 } else {
11824 Bytes::new(__input)
11825 };
11826 let mut __struct = Self::default();
11827 __struct.breach_time = buf.get_u32_le()?;
11828 __struct.breach_count = buf.get_u16_le()?;
11829 __struct.breach_status = buf.get_u8()?;
11830 let tmp = buf.get_u8()?;
11831 __struct.breach_type =
11832 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11833 enum_type: "FenceBreach",
11834 value: tmp as u64,
11835 })?;
11836 let tmp = buf.get_u8()?;
11837 __struct.breach_mitigation =
11838 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11839 enum_type: "FenceMitigate",
11840 value: tmp as u64,
11841 })?;
11842 Ok(__struct)
11843 }
11844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11845 let mut __tmp = BytesMut::new(bytes);
11846 #[allow(clippy::absurd_extreme_comparisons)]
11847 #[allow(unused_comparisons)]
11848 if __tmp.remaining() < Self::ENCODED_LEN {
11849 panic!(
11850 "buffer is too small (need {} bytes, but got {})",
11851 Self::ENCODED_LEN,
11852 __tmp.remaining(),
11853 )
11854 }
11855 __tmp.put_u32_le(self.breach_time);
11856 __tmp.put_u16_le(self.breach_count);
11857 __tmp.put_u8(self.breach_status);
11858 __tmp.put_u8(self.breach_type as u8);
11859 if matches!(version, MavlinkVersion::V2) {
11860 __tmp.put_u8(self.breach_mitigation as u8);
11861 let len = __tmp.len();
11862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11863 } else {
11864 __tmp.len()
11865 }
11866 }
11867}
11868#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11869#[doc = ""]
11870#[doc = "ID: 110"]
11871#[derive(Debug, Clone, PartialEq)]
11872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11874#[cfg_attr(feature = "ts", derive(TS))]
11875#[cfg_attr(feature = "ts", ts(export))]
11876pub struct FILE_TRANSFER_PROTOCOL_DATA {
11877 #[doc = "Network ID (0 for broadcast)"]
11878 pub target_network: u8,
11879 #[doc = "System ID (0 for broadcast)"]
11880 pub target_system: u8,
11881 #[doc = "Component ID (0 for broadcast)"]
11882 pub target_component: u8,
11883 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11884 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11885 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11886 pub payload: [u8; 251],
11887}
11888impl FILE_TRANSFER_PROTOCOL_DATA {
11889 pub const ENCODED_LEN: usize = 254usize;
11890 pub const DEFAULT: Self = Self {
11891 target_network: 0_u8,
11892 target_system: 0_u8,
11893 target_component: 0_u8,
11894 payload: [0_u8; 251usize],
11895 };
11896 #[cfg(feature = "arbitrary")]
11897 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11898 use arbitrary::{Arbitrary, Unstructured};
11899 let mut buf = [0u8; 1024];
11900 rng.fill_bytes(&mut buf);
11901 let mut unstructured = Unstructured::new(&buf);
11902 Self::arbitrary(&mut unstructured).unwrap_or_default()
11903 }
11904}
11905impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11906 fn default() -> Self {
11907 Self::DEFAULT.clone()
11908 }
11909}
11910impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11911 type Message = MavMessage;
11912 const ID: u32 = 110u32;
11913 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11914 const EXTRA_CRC: u8 = 84u8;
11915 const ENCODED_LEN: usize = 254usize;
11916 fn deser(
11917 _version: MavlinkVersion,
11918 __input: &[u8],
11919 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11920 let avail_len = __input.len();
11921 let mut payload_buf = [0; Self::ENCODED_LEN];
11922 let mut buf = if avail_len < Self::ENCODED_LEN {
11923 payload_buf[0..avail_len].copy_from_slice(__input);
11924 Bytes::new(&payload_buf)
11925 } else {
11926 Bytes::new(__input)
11927 };
11928 let mut __struct = Self::default();
11929 __struct.target_network = buf.get_u8()?;
11930 __struct.target_system = buf.get_u8()?;
11931 __struct.target_component = buf.get_u8()?;
11932 for v in &mut __struct.payload {
11933 let val = buf.get_u8()?;
11934 *v = val;
11935 }
11936 Ok(__struct)
11937 }
11938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11939 let mut __tmp = BytesMut::new(bytes);
11940 #[allow(clippy::absurd_extreme_comparisons)]
11941 #[allow(unused_comparisons)]
11942 if __tmp.remaining() < Self::ENCODED_LEN {
11943 panic!(
11944 "buffer is too small (need {} bytes, but got {})",
11945 Self::ENCODED_LEN,
11946 __tmp.remaining(),
11947 )
11948 }
11949 __tmp.put_u8(self.target_network);
11950 __tmp.put_u8(self.target_system);
11951 __tmp.put_u8(self.target_component);
11952 for val in &self.payload {
11953 __tmp.put_u8(*val);
11954 }
11955 if matches!(version, MavlinkVersion::V2) {
11956 let len = __tmp.len();
11957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11958 } else {
11959 __tmp.len()
11960 }
11961 }
11962}
11963#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11964#[doc = ""]
11965#[doc = "ID: 264"]
11966#[derive(Debug, Clone, PartialEq)]
11967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11969#[cfg_attr(feature = "ts", derive(TS))]
11970#[cfg_attr(feature = "ts", ts(export))]
11971pub struct FLIGHT_INFORMATION_DATA {
11972 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11973 pub arming_time_utc: u64,
11974 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11975 pub takeoff_time_utc: u64,
11976 #[doc = "Flight number. Note, field is misnamed UUID."]
11977 pub flight_uuid: u64,
11978 #[doc = "Timestamp (time since system boot)."]
11979 pub time_boot_ms: u32,
11980 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11982 pub landing_time: u32,
11983}
11984impl FLIGHT_INFORMATION_DATA {
11985 pub const ENCODED_LEN: usize = 32usize;
11986 pub const DEFAULT: Self = Self {
11987 arming_time_utc: 0_u64,
11988 takeoff_time_utc: 0_u64,
11989 flight_uuid: 0_u64,
11990 time_boot_ms: 0_u32,
11991 landing_time: 0_u32,
11992 };
11993 #[cfg(feature = "arbitrary")]
11994 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11995 use arbitrary::{Arbitrary, Unstructured};
11996 let mut buf = [0u8; 1024];
11997 rng.fill_bytes(&mut buf);
11998 let mut unstructured = Unstructured::new(&buf);
11999 Self::arbitrary(&mut unstructured).unwrap_or_default()
12000 }
12001}
12002impl Default for FLIGHT_INFORMATION_DATA {
12003 fn default() -> Self {
12004 Self::DEFAULT.clone()
12005 }
12006}
12007impl MessageData for FLIGHT_INFORMATION_DATA {
12008 type Message = MavMessage;
12009 const ID: u32 = 264u32;
12010 const NAME: &'static str = "FLIGHT_INFORMATION";
12011 const EXTRA_CRC: u8 = 49u8;
12012 const ENCODED_LEN: usize = 32usize;
12013 fn deser(
12014 _version: MavlinkVersion,
12015 __input: &[u8],
12016 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12017 let avail_len = __input.len();
12018 let mut payload_buf = [0; Self::ENCODED_LEN];
12019 let mut buf = if avail_len < Self::ENCODED_LEN {
12020 payload_buf[0..avail_len].copy_from_slice(__input);
12021 Bytes::new(&payload_buf)
12022 } else {
12023 Bytes::new(__input)
12024 };
12025 let mut __struct = Self::default();
12026 __struct.arming_time_utc = buf.get_u64_le()?;
12027 __struct.takeoff_time_utc = buf.get_u64_le()?;
12028 __struct.flight_uuid = buf.get_u64_le()?;
12029 __struct.time_boot_ms = buf.get_u32_le()?;
12030 __struct.landing_time = buf.get_u32_le()?;
12031 Ok(__struct)
12032 }
12033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12034 let mut __tmp = BytesMut::new(bytes);
12035 #[allow(clippy::absurd_extreme_comparisons)]
12036 #[allow(unused_comparisons)]
12037 if __tmp.remaining() < Self::ENCODED_LEN {
12038 panic!(
12039 "buffer is too small (need {} bytes, but got {})",
12040 Self::ENCODED_LEN,
12041 __tmp.remaining(),
12042 )
12043 }
12044 __tmp.put_u64_le(self.arming_time_utc);
12045 __tmp.put_u64_le(self.takeoff_time_utc);
12046 __tmp.put_u64_le(self.flight_uuid);
12047 __tmp.put_u32_le(self.time_boot_ms);
12048 if matches!(version, MavlinkVersion::V2) {
12049 __tmp.put_u32_le(self.landing_time);
12050 let len = __tmp.len();
12051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12052 } else {
12053 __tmp.len()
12054 }
12055 }
12056}
12057#[doc = "Current motion information from a designated system."]
12058#[doc = ""]
12059#[doc = "ID: 144"]
12060#[derive(Debug, Clone, PartialEq)]
12061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12063#[cfg_attr(feature = "ts", derive(TS))]
12064#[cfg_attr(feature = "ts", ts(export))]
12065pub struct FOLLOW_TARGET_DATA {
12066 #[doc = "Timestamp (time since system boot)."]
12067 pub timestamp: u64,
12068 #[doc = "button states or switches of a tracker device"]
12069 pub custom_state: u64,
12070 #[doc = "Latitude (WGS84)"]
12071 pub lat: i32,
12072 #[doc = "Longitude (WGS84)"]
12073 pub lon: i32,
12074 #[doc = "Altitude (MSL)"]
12075 pub alt: f32,
12076 #[doc = "target velocity (0,0,0) for unknown"]
12077 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12078 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12079 pub vel: [f32; 3],
12080 #[doc = "linear target acceleration (0,0,0) for unknown"]
12081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12082 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12083 pub acc: [f32; 3],
12084 #[doc = "(0 0 0 0 for unknown)"]
12085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12086 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12087 pub attitude_q: [f32; 4],
12088 #[doc = "(0 0 0 for unknown)"]
12089 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12090 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12091 pub rates: [f32; 3],
12092 #[doc = "eph epv"]
12093 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12094 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12095 pub position_cov: [f32; 3],
12096 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12097 pub est_capabilities: u8,
12098}
12099impl FOLLOW_TARGET_DATA {
12100 pub const ENCODED_LEN: usize = 93usize;
12101 pub const DEFAULT: Self = Self {
12102 timestamp: 0_u64,
12103 custom_state: 0_u64,
12104 lat: 0_i32,
12105 lon: 0_i32,
12106 alt: 0.0_f32,
12107 vel: [0.0_f32; 3usize],
12108 acc: [0.0_f32; 3usize],
12109 attitude_q: [0.0_f32; 4usize],
12110 rates: [0.0_f32; 3usize],
12111 position_cov: [0.0_f32; 3usize],
12112 est_capabilities: 0_u8,
12113 };
12114 #[cfg(feature = "arbitrary")]
12115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12116 use arbitrary::{Arbitrary, Unstructured};
12117 let mut buf = [0u8; 1024];
12118 rng.fill_bytes(&mut buf);
12119 let mut unstructured = Unstructured::new(&buf);
12120 Self::arbitrary(&mut unstructured).unwrap_or_default()
12121 }
12122}
12123impl Default for FOLLOW_TARGET_DATA {
12124 fn default() -> Self {
12125 Self::DEFAULT.clone()
12126 }
12127}
12128impl MessageData for FOLLOW_TARGET_DATA {
12129 type Message = MavMessage;
12130 const ID: u32 = 144u32;
12131 const NAME: &'static str = "FOLLOW_TARGET";
12132 const EXTRA_CRC: u8 = 127u8;
12133 const ENCODED_LEN: usize = 93usize;
12134 fn deser(
12135 _version: MavlinkVersion,
12136 __input: &[u8],
12137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12138 let avail_len = __input.len();
12139 let mut payload_buf = [0; Self::ENCODED_LEN];
12140 let mut buf = if avail_len < Self::ENCODED_LEN {
12141 payload_buf[0..avail_len].copy_from_slice(__input);
12142 Bytes::new(&payload_buf)
12143 } else {
12144 Bytes::new(__input)
12145 };
12146 let mut __struct = Self::default();
12147 __struct.timestamp = buf.get_u64_le()?;
12148 __struct.custom_state = buf.get_u64_le()?;
12149 __struct.lat = buf.get_i32_le()?;
12150 __struct.lon = buf.get_i32_le()?;
12151 __struct.alt = buf.get_f32_le()?;
12152 for v in &mut __struct.vel {
12153 let val = buf.get_f32_le()?;
12154 *v = val;
12155 }
12156 for v in &mut __struct.acc {
12157 let val = buf.get_f32_le()?;
12158 *v = val;
12159 }
12160 for v in &mut __struct.attitude_q {
12161 let val = buf.get_f32_le()?;
12162 *v = val;
12163 }
12164 for v in &mut __struct.rates {
12165 let val = buf.get_f32_le()?;
12166 *v = val;
12167 }
12168 for v in &mut __struct.position_cov {
12169 let val = buf.get_f32_le()?;
12170 *v = val;
12171 }
12172 __struct.est_capabilities = buf.get_u8()?;
12173 Ok(__struct)
12174 }
12175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12176 let mut __tmp = BytesMut::new(bytes);
12177 #[allow(clippy::absurd_extreme_comparisons)]
12178 #[allow(unused_comparisons)]
12179 if __tmp.remaining() < Self::ENCODED_LEN {
12180 panic!(
12181 "buffer is too small (need {} bytes, but got {})",
12182 Self::ENCODED_LEN,
12183 __tmp.remaining(),
12184 )
12185 }
12186 __tmp.put_u64_le(self.timestamp);
12187 __tmp.put_u64_le(self.custom_state);
12188 __tmp.put_i32_le(self.lat);
12189 __tmp.put_i32_le(self.lon);
12190 __tmp.put_f32_le(self.alt);
12191 for val in &self.vel {
12192 __tmp.put_f32_le(*val);
12193 }
12194 for val in &self.acc {
12195 __tmp.put_f32_le(*val);
12196 }
12197 for val in &self.attitude_q {
12198 __tmp.put_f32_le(*val);
12199 }
12200 for val in &self.rates {
12201 __tmp.put_f32_le(*val);
12202 }
12203 for val in &self.position_cov {
12204 __tmp.put_f32_le(*val);
12205 }
12206 __tmp.put_u8(self.est_capabilities);
12207 if matches!(version, MavlinkVersion::V2) {
12208 let len = __tmp.len();
12209 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12210 } else {
12211 __tmp.len()
12212 }
12213 }
12214}
12215#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12216#[doc = ""]
12217#[doc = "ID: 371"]
12218#[derive(Debug, Clone, PartialEq)]
12219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12221#[cfg_attr(feature = "ts", derive(TS))]
12222#[cfg_attr(feature = "ts", ts(export))]
12223pub struct FUEL_STATUS_DATA {
12224 #[doc = "Capacity when full. Must be provided."]
12225 pub maximum_fuel: f32,
12226 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12227 pub consumed_fuel: f32,
12228 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12229 pub remaining_fuel: f32,
12230 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12231 pub flow_rate: f32,
12232 #[doc = "Fuel temperature. NaN: field not provided."]
12233 pub temperature: f32,
12234 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12235 pub fuel_type: MavFuelType,
12236 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12237 pub id: u8,
12238 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12239 pub percent_remaining: u8,
12240}
12241impl FUEL_STATUS_DATA {
12242 pub const ENCODED_LEN: usize = 26usize;
12243 pub const DEFAULT: Self = Self {
12244 maximum_fuel: 0.0_f32,
12245 consumed_fuel: 0.0_f32,
12246 remaining_fuel: 0.0_f32,
12247 flow_rate: 0.0_f32,
12248 temperature: 0.0_f32,
12249 fuel_type: MavFuelType::DEFAULT,
12250 id: 0_u8,
12251 percent_remaining: 0_u8,
12252 };
12253 #[cfg(feature = "arbitrary")]
12254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12255 use arbitrary::{Arbitrary, Unstructured};
12256 let mut buf = [0u8; 1024];
12257 rng.fill_bytes(&mut buf);
12258 let mut unstructured = Unstructured::new(&buf);
12259 Self::arbitrary(&mut unstructured).unwrap_or_default()
12260 }
12261}
12262impl Default for FUEL_STATUS_DATA {
12263 fn default() -> Self {
12264 Self::DEFAULT.clone()
12265 }
12266}
12267impl MessageData for FUEL_STATUS_DATA {
12268 type Message = MavMessage;
12269 const ID: u32 = 371u32;
12270 const NAME: &'static str = "FUEL_STATUS";
12271 const EXTRA_CRC: u8 = 10u8;
12272 const ENCODED_LEN: usize = 26usize;
12273 fn deser(
12274 _version: MavlinkVersion,
12275 __input: &[u8],
12276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12277 let avail_len = __input.len();
12278 let mut payload_buf = [0; Self::ENCODED_LEN];
12279 let mut buf = if avail_len < Self::ENCODED_LEN {
12280 payload_buf[0..avail_len].copy_from_slice(__input);
12281 Bytes::new(&payload_buf)
12282 } else {
12283 Bytes::new(__input)
12284 };
12285 let mut __struct = Self::default();
12286 __struct.maximum_fuel = buf.get_f32_le()?;
12287 __struct.consumed_fuel = buf.get_f32_le()?;
12288 __struct.remaining_fuel = buf.get_f32_le()?;
12289 __struct.flow_rate = buf.get_f32_le()?;
12290 __struct.temperature = buf.get_f32_le()?;
12291 let tmp = buf.get_u32_le()?;
12292 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12293 ::mavlink_core::error::ParserError::InvalidEnum {
12294 enum_type: "MavFuelType",
12295 value: tmp as u64,
12296 },
12297 )?;
12298 __struct.id = buf.get_u8()?;
12299 __struct.percent_remaining = buf.get_u8()?;
12300 Ok(__struct)
12301 }
12302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12303 let mut __tmp = BytesMut::new(bytes);
12304 #[allow(clippy::absurd_extreme_comparisons)]
12305 #[allow(unused_comparisons)]
12306 if __tmp.remaining() < Self::ENCODED_LEN {
12307 panic!(
12308 "buffer is too small (need {} bytes, but got {})",
12309 Self::ENCODED_LEN,
12310 __tmp.remaining(),
12311 )
12312 }
12313 __tmp.put_f32_le(self.maximum_fuel);
12314 __tmp.put_f32_le(self.consumed_fuel);
12315 __tmp.put_f32_le(self.remaining_fuel);
12316 __tmp.put_f32_le(self.flow_rate);
12317 __tmp.put_f32_le(self.temperature);
12318 __tmp.put_u32_le(self.fuel_type as u32);
12319 __tmp.put_u8(self.id);
12320 __tmp.put_u8(self.percent_remaining);
12321 if matches!(version, MavlinkVersion::V2) {
12322 let len = __tmp.len();
12323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12324 } else {
12325 __tmp.len()
12326 }
12327 }
12328}
12329#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12330#[doc = ""]
12331#[doc = "ID: 373"]
12332#[derive(Debug, Clone, PartialEq)]
12333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12335#[cfg_attr(feature = "ts", derive(TS))]
12336#[cfg_attr(feature = "ts", ts(export))]
12337pub struct GENERATOR_STATUS_DATA {
12338 #[doc = "Status flags."]
12339 pub status: MavGeneratorStatusFlag,
12340 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12341 pub battery_current: f32,
12342 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12343 pub load_current: f32,
12344 #[doc = "The power being generated. NaN: field not provided"]
12345 pub power_generated: f32,
12346 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12347 pub bus_voltage: f32,
12348 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12349 pub bat_current_setpoint: f32,
12350 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12351 pub runtime: u32,
12352 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12353 pub time_until_maintenance: i32,
12354 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12355 pub generator_speed: u16,
12356 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12357 pub rectifier_temperature: i16,
12358 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12359 pub generator_temperature: i16,
12360}
12361impl GENERATOR_STATUS_DATA {
12362 pub const ENCODED_LEN: usize = 42usize;
12363 pub const DEFAULT: Self = Self {
12364 status: MavGeneratorStatusFlag::DEFAULT,
12365 battery_current: 0.0_f32,
12366 load_current: 0.0_f32,
12367 power_generated: 0.0_f32,
12368 bus_voltage: 0.0_f32,
12369 bat_current_setpoint: 0.0_f32,
12370 runtime: 0_u32,
12371 time_until_maintenance: 0_i32,
12372 generator_speed: 0_u16,
12373 rectifier_temperature: 0_i16,
12374 generator_temperature: 0_i16,
12375 };
12376 #[cfg(feature = "arbitrary")]
12377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12378 use arbitrary::{Arbitrary, Unstructured};
12379 let mut buf = [0u8; 1024];
12380 rng.fill_bytes(&mut buf);
12381 let mut unstructured = Unstructured::new(&buf);
12382 Self::arbitrary(&mut unstructured).unwrap_or_default()
12383 }
12384}
12385impl Default for GENERATOR_STATUS_DATA {
12386 fn default() -> Self {
12387 Self::DEFAULT.clone()
12388 }
12389}
12390impl MessageData for GENERATOR_STATUS_DATA {
12391 type Message = MavMessage;
12392 const ID: u32 = 373u32;
12393 const NAME: &'static str = "GENERATOR_STATUS";
12394 const EXTRA_CRC: u8 = 117u8;
12395 const ENCODED_LEN: usize = 42usize;
12396 fn deser(
12397 _version: MavlinkVersion,
12398 __input: &[u8],
12399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12400 let avail_len = __input.len();
12401 let mut payload_buf = [0; Self::ENCODED_LEN];
12402 let mut buf = if avail_len < Self::ENCODED_LEN {
12403 payload_buf[0..avail_len].copy_from_slice(__input);
12404 Bytes::new(&payload_buf)
12405 } else {
12406 Bytes::new(__input)
12407 };
12408 let mut __struct = Self::default();
12409 let tmp = buf.get_u64_le()?;
12410 __struct.status =
12411 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
12412 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12413 flag_type: "MavGeneratorStatusFlag",
12414 value: tmp as u64,
12415 })?;
12416 __struct.battery_current = buf.get_f32_le()?;
12417 __struct.load_current = buf.get_f32_le()?;
12418 __struct.power_generated = buf.get_f32_le()?;
12419 __struct.bus_voltage = buf.get_f32_le()?;
12420 __struct.bat_current_setpoint = buf.get_f32_le()?;
12421 __struct.runtime = buf.get_u32_le()?;
12422 __struct.time_until_maintenance = buf.get_i32_le()?;
12423 __struct.generator_speed = buf.get_u16_le()?;
12424 __struct.rectifier_temperature = buf.get_i16_le()?;
12425 __struct.generator_temperature = buf.get_i16_le()?;
12426 Ok(__struct)
12427 }
12428 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12429 let mut __tmp = BytesMut::new(bytes);
12430 #[allow(clippy::absurd_extreme_comparisons)]
12431 #[allow(unused_comparisons)]
12432 if __tmp.remaining() < Self::ENCODED_LEN {
12433 panic!(
12434 "buffer is too small (need {} bytes, but got {})",
12435 Self::ENCODED_LEN,
12436 __tmp.remaining(),
12437 )
12438 }
12439 __tmp.put_u64_le(self.status.bits() as u64);
12440 __tmp.put_f32_le(self.battery_current);
12441 __tmp.put_f32_le(self.load_current);
12442 __tmp.put_f32_le(self.power_generated);
12443 __tmp.put_f32_le(self.bus_voltage);
12444 __tmp.put_f32_le(self.bat_current_setpoint);
12445 __tmp.put_u32_le(self.runtime);
12446 __tmp.put_i32_le(self.time_until_maintenance);
12447 __tmp.put_u16_le(self.generator_speed);
12448 __tmp.put_i16_le(self.rectifier_temperature);
12449 __tmp.put_i16_le(self.generator_temperature);
12450 if matches!(version, MavlinkVersion::V2) {
12451 let len = __tmp.len();
12452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12453 } else {
12454 __tmp.len()
12455 }
12456 }
12457}
12458#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12459#[doc = ""]
12460#[doc = "ID: 285"]
12461#[derive(Debug, Clone, PartialEq)]
12462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12464#[cfg_attr(feature = "ts", derive(TS))]
12465#[cfg_attr(feature = "ts", ts(export))]
12466pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12467 #[doc = "Timestamp (time since system boot)."]
12468 pub time_boot_ms: u32,
12469 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12471 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12472 pub q: [f32; 4],
12473 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12474 pub angular_velocity_x: f32,
12475 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12476 pub angular_velocity_y: f32,
12477 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12478 pub angular_velocity_z: f32,
12479 #[doc = "Failure flags (0 for no failure)"]
12480 pub failure_flags: GimbalDeviceErrorFlags,
12481 #[doc = "Current gimbal flags set."]
12482 pub flags: GimbalDeviceFlags,
12483 #[doc = "System ID"]
12484 pub target_system: u8,
12485 #[doc = "Component ID"]
12486 pub target_component: u8,
12487 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12489 pub delta_yaw: f32,
12490 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12492 pub delta_yaw_velocity: f32,
12493 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12495 pub gimbal_device_id: u8,
12496}
12497impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12498 pub const ENCODED_LEN: usize = 49usize;
12499 pub const DEFAULT: Self = Self {
12500 time_boot_ms: 0_u32,
12501 q: [0.0_f32; 4usize],
12502 angular_velocity_x: 0.0_f32,
12503 angular_velocity_y: 0.0_f32,
12504 angular_velocity_z: 0.0_f32,
12505 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12506 flags: GimbalDeviceFlags::DEFAULT,
12507 target_system: 0_u8,
12508 target_component: 0_u8,
12509 delta_yaw: 0.0_f32,
12510 delta_yaw_velocity: 0.0_f32,
12511 gimbal_device_id: 0_u8,
12512 };
12513 #[cfg(feature = "arbitrary")]
12514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12515 use arbitrary::{Arbitrary, Unstructured};
12516 let mut buf = [0u8; 1024];
12517 rng.fill_bytes(&mut buf);
12518 let mut unstructured = Unstructured::new(&buf);
12519 Self::arbitrary(&mut unstructured).unwrap_or_default()
12520 }
12521}
12522impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12523 fn default() -> Self {
12524 Self::DEFAULT.clone()
12525 }
12526}
12527impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12528 type Message = MavMessage;
12529 const ID: u32 = 285u32;
12530 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12531 const EXTRA_CRC: u8 = 137u8;
12532 const ENCODED_LEN: usize = 49usize;
12533 fn deser(
12534 _version: MavlinkVersion,
12535 __input: &[u8],
12536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12537 let avail_len = __input.len();
12538 let mut payload_buf = [0; Self::ENCODED_LEN];
12539 let mut buf = if avail_len < Self::ENCODED_LEN {
12540 payload_buf[0..avail_len].copy_from_slice(__input);
12541 Bytes::new(&payload_buf)
12542 } else {
12543 Bytes::new(__input)
12544 };
12545 let mut __struct = Self::default();
12546 __struct.time_boot_ms = buf.get_u32_le()?;
12547 for v in &mut __struct.q {
12548 let val = buf.get_f32_le()?;
12549 *v = val;
12550 }
12551 __struct.angular_velocity_x = buf.get_f32_le()?;
12552 __struct.angular_velocity_y = buf.get_f32_le()?;
12553 __struct.angular_velocity_z = buf.get_f32_le()?;
12554 let tmp = buf.get_u32_le()?;
12555 __struct.failure_flags =
12556 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
12557 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12558 flag_type: "GimbalDeviceErrorFlags",
12559 value: tmp as u64,
12560 })?;
12561 let tmp = buf.get_u16_le()?;
12562 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12563 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12564 flag_type: "GimbalDeviceFlags",
12565 value: tmp as u64,
12566 })?;
12567 __struct.target_system = buf.get_u8()?;
12568 __struct.target_component = buf.get_u8()?;
12569 __struct.delta_yaw = buf.get_f32_le()?;
12570 __struct.delta_yaw_velocity = buf.get_f32_le()?;
12571 __struct.gimbal_device_id = buf.get_u8()?;
12572 Ok(__struct)
12573 }
12574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12575 let mut __tmp = BytesMut::new(bytes);
12576 #[allow(clippy::absurd_extreme_comparisons)]
12577 #[allow(unused_comparisons)]
12578 if __tmp.remaining() < Self::ENCODED_LEN {
12579 panic!(
12580 "buffer is too small (need {} bytes, but got {})",
12581 Self::ENCODED_LEN,
12582 __tmp.remaining(),
12583 )
12584 }
12585 __tmp.put_u32_le(self.time_boot_ms);
12586 for val in &self.q {
12587 __tmp.put_f32_le(*val);
12588 }
12589 __tmp.put_f32_le(self.angular_velocity_x);
12590 __tmp.put_f32_le(self.angular_velocity_y);
12591 __tmp.put_f32_le(self.angular_velocity_z);
12592 __tmp.put_u32_le(self.failure_flags.bits() as u32);
12593 __tmp.put_u16_le(self.flags.bits() as u16);
12594 __tmp.put_u8(self.target_system);
12595 __tmp.put_u8(self.target_component);
12596 if matches!(version, MavlinkVersion::V2) {
12597 __tmp.put_f32_le(self.delta_yaw);
12598 __tmp.put_f32_le(self.delta_yaw_velocity);
12599 __tmp.put_u8(self.gimbal_device_id);
12600 let len = __tmp.len();
12601 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12602 } else {
12603 __tmp.len()
12604 }
12605 }
12606}
12607#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12608#[doc = ""]
12609#[doc = "ID: 283"]
12610#[derive(Debug, Clone, PartialEq)]
12611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12613#[cfg_attr(feature = "ts", derive(TS))]
12614#[cfg_attr(feature = "ts", ts(export))]
12615pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12616 #[doc = "UID of gimbal hardware (0 if unknown)."]
12617 pub uid: u64,
12618 #[doc = "Timestamp (time since system boot)."]
12619 pub time_boot_ms: u32,
12620 #[doc = "Version of the gimbal firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
12621 pub firmware_version: u32,
12622 #[doc = "Version of the gimbal hardware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
12623 pub hardware_version: u32,
12624 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12625 pub roll_min: f32,
12626 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12627 pub roll_max: f32,
12628 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12629 pub pitch_min: f32,
12630 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12631 pub pitch_max: f32,
12632 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12633 pub yaw_min: f32,
12634 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12635 pub yaw_max: f32,
12636 #[doc = "Bitmap of gimbal capability flags."]
12637 pub cap_flags: GimbalDeviceCapFlags,
12638 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12639 pub custom_cap_flags: u16,
12640 #[doc = "Name of the gimbal vendor."]
12641 #[cfg_attr(feature = "ts", ts(type = "string"))]
12642 pub vendor_name: CharArray<32>,
12643 #[doc = "Name of the gimbal model."]
12644 #[cfg_attr(feature = "ts", ts(type = "string"))]
12645 pub model_name: CharArray<32>,
12646 #[doc = "Custom name of the gimbal given to it by the user."]
12647 #[cfg_attr(feature = "ts", ts(type = "string"))]
12648 pub custom_name: CharArray<32>,
12649 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12651 pub gimbal_device_id: u8,
12652}
12653impl GIMBAL_DEVICE_INFORMATION_DATA {
12654 pub const ENCODED_LEN: usize = 145usize;
12655 pub const DEFAULT: Self = Self {
12656 uid: 0_u64,
12657 time_boot_ms: 0_u32,
12658 firmware_version: 0_u32,
12659 hardware_version: 0_u32,
12660 roll_min: 0.0_f32,
12661 roll_max: 0.0_f32,
12662 pitch_min: 0.0_f32,
12663 pitch_max: 0.0_f32,
12664 yaw_min: 0.0_f32,
12665 yaw_max: 0.0_f32,
12666 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12667 custom_cap_flags: 0_u16,
12668 vendor_name: CharArray::new([0_u8; 32usize]),
12669 model_name: CharArray::new([0_u8; 32usize]),
12670 custom_name: CharArray::new([0_u8; 32usize]),
12671 gimbal_device_id: 0_u8,
12672 };
12673 #[cfg(feature = "arbitrary")]
12674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12675 use arbitrary::{Arbitrary, Unstructured};
12676 let mut buf = [0u8; 1024];
12677 rng.fill_bytes(&mut buf);
12678 let mut unstructured = Unstructured::new(&buf);
12679 Self::arbitrary(&mut unstructured).unwrap_or_default()
12680 }
12681}
12682impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12683 fn default() -> Self {
12684 Self::DEFAULT.clone()
12685 }
12686}
12687impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12688 type Message = MavMessage;
12689 const ID: u32 = 283u32;
12690 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12691 const EXTRA_CRC: u8 = 74u8;
12692 const ENCODED_LEN: usize = 145usize;
12693 fn deser(
12694 _version: MavlinkVersion,
12695 __input: &[u8],
12696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12697 let avail_len = __input.len();
12698 let mut payload_buf = [0; Self::ENCODED_LEN];
12699 let mut buf = if avail_len < Self::ENCODED_LEN {
12700 payload_buf[0..avail_len].copy_from_slice(__input);
12701 Bytes::new(&payload_buf)
12702 } else {
12703 Bytes::new(__input)
12704 };
12705 let mut __struct = Self::default();
12706 __struct.uid = buf.get_u64_le()?;
12707 __struct.time_boot_ms = buf.get_u32_le()?;
12708 __struct.firmware_version = buf.get_u32_le()?;
12709 __struct.hardware_version = buf.get_u32_le()?;
12710 __struct.roll_min = buf.get_f32_le()?;
12711 __struct.roll_max = buf.get_f32_le()?;
12712 __struct.pitch_min = buf.get_f32_le()?;
12713 __struct.pitch_max = buf.get_f32_le()?;
12714 __struct.yaw_min = buf.get_f32_le()?;
12715 __struct.yaw_max = buf.get_f32_le()?;
12716 let tmp = buf.get_u16_le()?;
12717 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12718 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
12719 )
12720 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12721 flag_type: "GimbalDeviceCapFlags",
12722 value: tmp as u64,
12723 })?;
12724 __struct.custom_cap_flags = buf.get_u16_le()?;
12725 let mut tmp = [0_u8; 32usize];
12726 for v in &mut tmp {
12727 *v = buf.get_u8()?;
12728 }
12729 __struct.vendor_name = CharArray::new(tmp);
12730 let mut tmp = [0_u8; 32usize];
12731 for v in &mut tmp {
12732 *v = buf.get_u8()?;
12733 }
12734 __struct.model_name = CharArray::new(tmp);
12735 let mut tmp = [0_u8; 32usize];
12736 for v in &mut tmp {
12737 *v = buf.get_u8()?;
12738 }
12739 __struct.custom_name = CharArray::new(tmp);
12740 __struct.gimbal_device_id = buf.get_u8()?;
12741 Ok(__struct)
12742 }
12743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12744 let mut __tmp = BytesMut::new(bytes);
12745 #[allow(clippy::absurd_extreme_comparisons)]
12746 #[allow(unused_comparisons)]
12747 if __tmp.remaining() < Self::ENCODED_LEN {
12748 panic!(
12749 "buffer is too small (need {} bytes, but got {})",
12750 Self::ENCODED_LEN,
12751 __tmp.remaining(),
12752 )
12753 }
12754 __tmp.put_u64_le(self.uid);
12755 __tmp.put_u32_le(self.time_boot_ms);
12756 __tmp.put_u32_le(self.firmware_version);
12757 __tmp.put_u32_le(self.hardware_version);
12758 __tmp.put_f32_le(self.roll_min);
12759 __tmp.put_f32_le(self.roll_max);
12760 __tmp.put_f32_le(self.pitch_min);
12761 __tmp.put_f32_le(self.pitch_max);
12762 __tmp.put_f32_le(self.yaw_min);
12763 __tmp.put_f32_le(self.yaw_max);
12764 __tmp.put_u16_le(self.cap_flags.bits() as u16);
12765 __tmp.put_u16_le(self.custom_cap_flags);
12766 for val in &self.vendor_name {
12767 __tmp.put_u8(*val);
12768 }
12769 for val in &self.model_name {
12770 __tmp.put_u8(*val);
12771 }
12772 for val in &self.custom_name {
12773 __tmp.put_u8(*val);
12774 }
12775 if matches!(version, MavlinkVersion::V2) {
12776 __tmp.put_u8(self.gimbal_device_id);
12777 let len = __tmp.len();
12778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12779 } else {
12780 __tmp.len()
12781 }
12782 }
12783}
12784#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12785#[doc = ""]
12786#[doc = "ID: 284"]
12787#[derive(Debug, Clone, PartialEq)]
12788#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12790#[cfg_attr(feature = "ts", derive(TS))]
12791#[cfg_attr(feature = "ts", ts(export))]
12792pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12793 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12795 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12796 pub q: [f32; 4],
12797 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12798 pub angular_velocity_x: f32,
12799 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12800 pub angular_velocity_y: f32,
12801 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12802 pub angular_velocity_z: f32,
12803 #[doc = "Low level gimbal flags."]
12804 pub flags: GimbalDeviceFlags,
12805 #[doc = "System ID"]
12806 pub target_system: u8,
12807 #[doc = "Component ID"]
12808 pub target_component: u8,
12809}
12810impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12811 pub const ENCODED_LEN: usize = 32usize;
12812 pub const DEFAULT: Self = Self {
12813 q: [0.0_f32; 4usize],
12814 angular_velocity_x: 0.0_f32,
12815 angular_velocity_y: 0.0_f32,
12816 angular_velocity_z: 0.0_f32,
12817 flags: GimbalDeviceFlags::DEFAULT,
12818 target_system: 0_u8,
12819 target_component: 0_u8,
12820 };
12821 #[cfg(feature = "arbitrary")]
12822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12823 use arbitrary::{Arbitrary, Unstructured};
12824 let mut buf = [0u8; 1024];
12825 rng.fill_bytes(&mut buf);
12826 let mut unstructured = Unstructured::new(&buf);
12827 Self::arbitrary(&mut unstructured).unwrap_or_default()
12828 }
12829}
12830impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12831 fn default() -> Self {
12832 Self::DEFAULT.clone()
12833 }
12834}
12835impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12836 type Message = MavMessage;
12837 const ID: u32 = 284u32;
12838 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12839 const EXTRA_CRC: u8 = 99u8;
12840 const ENCODED_LEN: usize = 32usize;
12841 fn deser(
12842 _version: MavlinkVersion,
12843 __input: &[u8],
12844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12845 let avail_len = __input.len();
12846 let mut payload_buf = [0; Self::ENCODED_LEN];
12847 let mut buf = if avail_len < Self::ENCODED_LEN {
12848 payload_buf[0..avail_len].copy_from_slice(__input);
12849 Bytes::new(&payload_buf)
12850 } else {
12851 Bytes::new(__input)
12852 };
12853 let mut __struct = Self::default();
12854 for v in &mut __struct.q {
12855 let val = buf.get_f32_le()?;
12856 *v = val;
12857 }
12858 __struct.angular_velocity_x = buf.get_f32_le()?;
12859 __struct.angular_velocity_y = buf.get_f32_le()?;
12860 __struct.angular_velocity_z = buf.get_f32_le()?;
12861 let tmp = buf.get_u16_le()?;
12862 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
12863 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12864 flag_type: "GimbalDeviceFlags",
12865 value: tmp as u64,
12866 })?;
12867 __struct.target_system = buf.get_u8()?;
12868 __struct.target_component = buf.get_u8()?;
12869 Ok(__struct)
12870 }
12871 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12872 let mut __tmp = BytesMut::new(bytes);
12873 #[allow(clippy::absurd_extreme_comparisons)]
12874 #[allow(unused_comparisons)]
12875 if __tmp.remaining() < Self::ENCODED_LEN {
12876 panic!(
12877 "buffer is too small (need {} bytes, but got {})",
12878 Self::ENCODED_LEN,
12879 __tmp.remaining(),
12880 )
12881 }
12882 for val in &self.q {
12883 __tmp.put_f32_le(*val);
12884 }
12885 __tmp.put_f32_le(self.angular_velocity_x);
12886 __tmp.put_f32_le(self.angular_velocity_y);
12887 __tmp.put_f32_le(self.angular_velocity_z);
12888 __tmp.put_u16_le(self.flags.bits() as u16);
12889 __tmp.put_u8(self.target_system);
12890 __tmp.put_u8(self.target_component);
12891 if matches!(version, MavlinkVersion::V2) {
12892 let len = __tmp.len();
12893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12894 } else {
12895 __tmp.len()
12896 }
12897 }
12898}
12899#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12900#[doc = ""]
12901#[doc = "ID: 280"]
12902#[derive(Debug, Clone, PartialEq)]
12903#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12904#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12905#[cfg_attr(feature = "ts", derive(TS))]
12906#[cfg_attr(feature = "ts", ts(export))]
12907pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12908 #[doc = "Timestamp (time since system boot)."]
12909 pub time_boot_ms: u32,
12910 #[doc = "Bitmap of gimbal capability flags."]
12911 pub cap_flags: GimbalManagerCapFlags,
12912 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12913 pub roll_min: f32,
12914 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12915 pub roll_max: f32,
12916 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12917 pub pitch_min: f32,
12918 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12919 pub pitch_max: f32,
12920 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12921 pub yaw_min: f32,
12922 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12923 pub yaw_max: f32,
12924 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12925 pub gimbal_device_id: u8,
12926}
12927impl GIMBAL_MANAGER_INFORMATION_DATA {
12928 pub const ENCODED_LEN: usize = 33usize;
12929 pub const DEFAULT: Self = Self {
12930 time_boot_ms: 0_u32,
12931 cap_flags: GimbalManagerCapFlags::DEFAULT,
12932 roll_min: 0.0_f32,
12933 roll_max: 0.0_f32,
12934 pitch_min: 0.0_f32,
12935 pitch_max: 0.0_f32,
12936 yaw_min: 0.0_f32,
12937 yaw_max: 0.0_f32,
12938 gimbal_device_id: 0_u8,
12939 };
12940 #[cfg(feature = "arbitrary")]
12941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12942 use arbitrary::{Arbitrary, Unstructured};
12943 let mut buf = [0u8; 1024];
12944 rng.fill_bytes(&mut buf);
12945 let mut unstructured = Unstructured::new(&buf);
12946 Self::arbitrary(&mut unstructured).unwrap_or_default()
12947 }
12948}
12949impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12950 fn default() -> Self {
12951 Self::DEFAULT.clone()
12952 }
12953}
12954impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12955 type Message = MavMessage;
12956 const ID: u32 = 280u32;
12957 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12958 const EXTRA_CRC: u8 = 70u8;
12959 const ENCODED_LEN: usize = 33usize;
12960 fn deser(
12961 _version: MavlinkVersion,
12962 __input: &[u8],
12963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12964 let avail_len = __input.len();
12965 let mut payload_buf = [0; Self::ENCODED_LEN];
12966 let mut buf = if avail_len < Self::ENCODED_LEN {
12967 payload_buf[0..avail_len].copy_from_slice(__input);
12968 Bytes::new(&payload_buf)
12969 } else {
12970 Bytes::new(__input)
12971 };
12972 let mut __struct = Self::default();
12973 __struct.time_boot_ms = buf.get_u32_le()?;
12974 let tmp = buf.get_u32_le()?;
12975 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12976 tmp as <GimbalManagerCapFlags as Flags>::Bits,
12977 )
12978 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12979 flag_type: "GimbalManagerCapFlags",
12980 value: tmp as u64,
12981 })?;
12982 __struct.roll_min = buf.get_f32_le()?;
12983 __struct.roll_max = buf.get_f32_le()?;
12984 __struct.pitch_min = buf.get_f32_le()?;
12985 __struct.pitch_max = buf.get_f32_le()?;
12986 __struct.yaw_min = buf.get_f32_le()?;
12987 __struct.yaw_max = buf.get_f32_le()?;
12988 __struct.gimbal_device_id = buf.get_u8()?;
12989 Ok(__struct)
12990 }
12991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12992 let mut __tmp = BytesMut::new(bytes);
12993 #[allow(clippy::absurd_extreme_comparisons)]
12994 #[allow(unused_comparisons)]
12995 if __tmp.remaining() < Self::ENCODED_LEN {
12996 panic!(
12997 "buffer is too small (need {} bytes, but got {})",
12998 Self::ENCODED_LEN,
12999 __tmp.remaining(),
13000 )
13001 }
13002 __tmp.put_u32_le(self.time_boot_ms);
13003 __tmp.put_u32_le(self.cap_flags.bits() as u32);
13004 __tmp.put_f32_le(self.roll_min);
13005 __tmp.put_f32_le(self.roll_max);
13006 __tmp.put_f32_le(self.pitch_min);
13007 __tmp.put_f32_le(self.pitch_max);
13008 __tmp.put_f32_le(self.yaw_min);
13009 __tmp.put_f32_le(self.yaw_max);
13010 __tmp.put_u8(self.gimbal_device_id);
13011 if matches!(version, MavlinkVersion::V2) {
13012 let len = __tmp.len();
13013 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13014 } else {
13015 __tmp.len()
13016 }
13017 }
13018}
13019#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13020#[doc = ""]
13021#[doc = "ID: 282"]
13022#[derive(Debug, Clone, PartialEq)]
13023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13025#[cfg_attr(feature = "ts", derive(TS))]
13026#[cfg_attr(feature = "ts", ts(export))]
13027pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13028 #[doc = "High level gimbal manager flags to use."]
13029 pub flags: GimbalManagerFlags,
13030 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13031 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13032 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13033 pub q: [f32; 4],
13034 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13035 pub angular_velocity_x: f32,
13036 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13037 pub angular_velocity_y: f32,
13038 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13039 pub angular_velocity_z: f32,
13040 #[doc = "System ID"]
13041 pub target_system: u8,
13042 #[doc = "Component ID"]
13043 pub target_component: u8,
13044 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13045 pub gimbal_device_id: u8,
13046}
13047impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13048 pub const ENCODED_LEN: usize = 35usize;
13049 pub const DEFAULT: Self = Self {
13050 flags: GimbalManagerFlags::DEFAULT,
13051 q: [0.0_f32; 4usize],
13052 angular_velocity_x: 0.0_f32,
13053 angular_velocity_y: 0.0_f32,
13054 angular_velocity_z: 0.0_f32,
13055 target_system: 0_u8,
13056 target_component: 0_u8,
13057 gimbal_device_id: 0_u8,
13058 };
13059 #[cfg(feature = "arbitrary")]
13060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13061 use arbitrary::{Arbitrary, Unstructured};
13062 let mut buf = [0u8; 1024];
13063 rng.fill_bytes(&mut buf);
13064 let mut unstructured = Unstructured::new(&buf);
13065 Self::arbitrary(&mut unstructured).unwrap_or_default()
13066 }
13067}
13068impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13069 fn default() -> Self {
13070 Self::DEFAULT.clone()
13071 }
13072}
13073impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13074 type Message = MavMessage;
13075 const ID: u32 = 282u32;
13076 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13077 const EXTRA_CRC: u8 = 123u8;
13078 const ENCODED_LEN: usize = 35usize;
13079 fn deser(
13080 _version: MavlinkVersion,
13081 __input: &[u8],
13082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13083 let avail_len = __input.len();
13084 let mut payload_buf = [0; Self::ENCODED_LEN];
13085 let mut buf = if avail_len < Self::ENCODED_LEN {
13086 payload_buf[0..avail_len].copy_from_slice(__input);
13087 Bytes::new(&payload_buf)
13088 } else {
13089 Bytes::new(__input)
13090 };
13091 let mut __struct = Self::default();
13092 let tmp = buf.get_u32_le()?;
13093 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13094 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13095 flag_type: "GimbalManagerFlags",
13096 value: tmp as u64,
13097 })?;
13098 for v in &mut __struct.q {
13099 let val = buf.get_f32_le()?;
13100 *v = val;
13101 }
13102 __struct.angular_velocity_x = buf.get_f32_le()?;
13103 __struct.angular_velocity_y = buf.get_f32_le()?;
13104 __struct.angular_velocity_z = buf.get_f32_le()?;
13105 __struct.target_system = buf.get_u8()?;
13106 __struct.target_component = buf.get_u8()?;
13107 __struct.gimbal_device_id = buf.get_u8()?;
13108 Ok(__struct)
13109 }
13110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13111 let mut __tmp = BytesMut::new(bytes);
13112 #[allow(clippy::absurd_extreme_comparisons)]
13113 #[allow(unused_comparisons)]
13114 if __tmp.remaining() < Self::ENCODED_LEN {
13115 panic!(
13116 "buffer is too small (need {} bytes, but got {})",
13117 Self::ENCODED_LEN,
13118 __tmp.remaining(),
13119 )
13120 }
13121 __tmp.put_u32_le(self.flags.bits() as u32);
13122 for val in &self.q {
13123 __tmp.put_f32_le(*val);
13124 }
13125 __tmp.put_f32_le(self.angular_velocity_x);
13126 __tmp.put_f32_le(self.angular_velocity_y);
13127 __tmp.put_f32_le(self.angular_velocity_z);
13128 __tmp.put_u8(self.target_system);
13129 __tmp.put_u8(self.target_component);
13130 __tmp.put_u8(self.gimbal_device_id);
13131 if matches!(version, MavlinkVersion::V2) {
13132 let len = __tmp.len();
13133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13134 } else {
13135 __tmp.len()
13136 }
13137 }
13138}
13139#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13140#[doc = ""]
13141#[doc = "ID: 288"]
13142#[derive(Debug, Clone, PartialEq)]
13143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13145#[cfg_attr(feature = "ts", derive(TS))]
13146#[cfg_attr(feature = "ts", ts(export))]
13147pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13148 #[doc = "High level gimbal manager flags."]
13149 pub flags: GimbalManagerFlags,
13150 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13151 pub pitch: f32,
13152 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13153 pub yaw: f32,
13154 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13155 pub pitch_rate: f32,
13156 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13157 pub yaw_rate: f32,
13158 #[doc = "System ID"]
13159 pub target_system: u8,
13160 #[doc = "Component ID"]
13161 pub target_component: u8,
13162 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13163 pub gimbal_device_id: u8,
13164}
13165impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13166 pub const ENCODED_LEN: usize = 23usize;
13167 pub const DEFAULT: Self = Self {
13168 flags: GimbalManagerFlags::DEFAULT,
13169 pitch: 0.0_f32,
13170 yaw: 0.0_f32,
13171 pitch_rate: 0.0_f32,
13172 yaw_rate: 0.0_f32,
13173 target_system: 0_u8,
13174 target_component: 0_u8,
13175 gimbal_device_id: 0_u8,
13176 };
13177 #[cfg(feature = "arbitrary")]
13178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13179 use arbitrary::{Arbitrary, Unstructured};
13180 let mut buf = [0u8; 1024];
13181 rng.fill_bytes(&mut buf);
13182 let mut unstructured = Unstructured::new(&buf);
13183 Self::arbitrary(&mut unstructured).unwrap_or_default()
13184 }
13185}
13186impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13187 fn default() -> Self {
13188 Self::DEFAULT.clone()
13189 }
13190}
13191impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13192 type Message = MavMessage;
13193 const ID: u32 = 288u32;
13194 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13195 const EXTRA_CRC: u8 = 20u8;
13196 const ENCODED_LEN: usize = 23usize;
13197 fn deser(
13198 _version: MavlinkVersion,
13199 __input: &[u8],
13200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13201 let avail_len = __input.len();
13202 let mut payload_buf = [0; Self::ENCODED_LEN];
13203 let mut buf = if avail_len < Self::ENCODED_LEN {
13204 payload_buf[0..avail_len].copy_from_slice(__input);
13205 Bytes::new(&payload_buf)
13206 } else {
13207 Bytes::new(__input)
13208 };
13209 let mut __struct = Self::default();
13210 let tmp = buf.get_u32_le()?;
13211 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13212 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13213 flag_type: "GimbalManagerFlags",
13214 value: tmp as u64,
13215 })?;
13216 __struct.pitch = buf.get_f32_le()?;
13217 __struct.yaw = buf.get_f32_le()?;
13218 __struct.pitch_rate = buf.get_f32_le()?;
13219 __struct.yaw_rate = buf.get_f32_le()?;
13220 __struct.target_system = buf.get_u8()?;
13221 __struct.target_component = buf.get_u8()?;
13222 __struct.gimbal_device_id = buf.get_u8()?;
13223 Ok(__struct)
13224 }
13225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13226 let mut __tmp = BytesMut::new(bytes);
13227 #[allow(clippy::absurd_extreme_comparisons)]
13228 #[allow(unused_comparisons)]
13229 if __tmp.remaining() < Self::ENCODED_LEN {
13230 panic!(
13231 "buffer is too small (need {} bytes, but got {})",
13232 Self::ENCODED_LEN,
13233 __tmp.remaining(),
13234 )
13235 }
13236 __tmp.put_u32_le(self.flags.bits() as u32);
13237 __tmp.put_f32_le(self.pitch);
13238 __tmp.put_f32_le(self.yaw);
13239 __tmp.put_f32_le(self.pitch_rate);
13240 __tmp.put_f32_le(self.yaw_rate);
13241 __tmp.put_u8(self.target_system);
13242 __tmp.put_u8(self.target_component);
13243 __tmp.put_u8(self.gimbal_device_id);
13244 if matches!(version, MavlinkVersion::V2) {
13245 let len = __tmp.len();
13246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13247 } else {
13248 __tmp.len()
13249 }
13250 }
13251}
13252#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13253#[doc = ""]
13254#[doc = "ID: 287"]
13255#[derive(Debug, Clone, PartialEq)]
13256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13258#[cfg_attr(feature = "ts", derive(TS))]
13259#[cfg_attr(feature = "ts", ts(export))]
13260pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13261 #[doc = "High level gimbal manager flags to use."]
13262 pub flags: GimbalManagerFlags,
13263 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13264 pub pitch: f32,
13265 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13266 pub yaw: f32,
13267 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13268 pub pitch_rate: f32,
13269 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13270 pub yaw_rate: f32,
13271 #[doc = "System ID"]
13272 pub target_system: u8,
13273 #[doc = "Component ID"]
13274 pub target_component: u8,
13275 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13276 pub gimbal_device_id: u8,
13277}
13278impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13279 pub const ENCODED_LEN: usize = 23usize;
13280 pub const DEFAULT: Self = Self {
13281 flags: GimbalManagerFlags::DEFAULT,
13282 pitch: 0.0_f32,
13283 yaw: 0.0_f32,
13284 pitch_rate: 0.0_f32,
13285 yaw_rate: 0.0_f32,
13286 target_system: 0_u8,
13287 target_component: 0_u8,
13288 gimbal_device_id: 0_u8,
13289 };
13290 #[cfg(feature = "arbitrary")]
13291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13292 use arbitrary::{Arbitrary, Unstructured};
13293 let mut buf = [0u8; 1024];
13294 rng.fill_bytes(&mut buf);
13295 let mut unstructured = Unstructured::new(&buf);
13296 Self::arbitrary(&mut unstructured).unwrap_or_default()
13297 }
13298}
13299impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13300 fn default() -> Self {
13301 Self::DEFAULT.clone()
13302 }
13303}
13304impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13305 type Message = MavMessage;
13306 const ID: u32 = 287u32;
13307 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13308 const EXTRA_CRC: u8 = 1u8;
13309 const ENCODED_LEN: usize = 23usize;
13310 fn deser(
13311 _version: MavlinkVersion,
13312 __input: &[u8],
13313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13314 let avail_len = __input.len();
13315 let mut payload_buf = [0; Self::ENCODED_LEN];
13316 let mut buf = if avail_len < Self::ENCODED_LEN {
13317 payload_buf[0..avail_len].copy_from_slice(__input);
13318 Bytes::new(&payload_buf)
13319 } else {
13320 Bytes::new(__input)
13321 };
13322 let mut __struct = Self::default();
13323 let tmp = buf.get_u32_le()?;
13324 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13325 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13326 flag_type: "GimbalManagerFlags",
13327 value: tmp as u64,
13328 })?;
13329 __struct.pitch = buf.get_f32_le()?;
13330 __struct.yaw = buf.get_f32_le()?;
13331 __struct.pitch_rate = buf.get_f32_le()?;
13332 __struct.yaw_rate = buf.get_f32_le()?;
13333 __struct.target_system = buf.get_u8()?;
13334 __struct.target_component = buf.get_u8()?;
13335 __struct.gimbal_device_id = buf.get_u8()?;
13336 Ok(__struct)
13337 }
13338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13339 let mut __tmp = BytesMut::new(bytes);
13340 #[allow(clippy::absurd_extreme_comparisons)]
13341 #[allow(unused_comparisons)]
13342 if __tmp.remaining() < Self::ENCODED_LEN {
13343 panic!(
13344 "buffer is too small (need {} bytes, but got {})",
13345 Self::ENCODED_LEN,
13346 __tmp.remaining(),
13347 )
13348 }
13349 __tmp.put_u32_le(self.flags.bits() as u32);
13350 __tmp.put_f32_le(self.pitch);
13351 __tmp.put_f32_le(self.yaw);
13352 __tmp.put_f32_le(self.pitch_rate);
13353 __tmp.put_f32_le(self.yaw_rate);
13354 __tmp.put_u8(self.target_system);
13355 __tmp.put_u8(self.target_component);
13356 __tmp.put_u8(self.gimbal_device_id);
13357 if matches!(version, MavlinkVersion::V2) {
13358 let len = __tmp.len();
13359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13360 } else {
13361 __tmp.len()
13362 }
13363 }
13364}
13365#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13366#[doc = ""]
13367#[doc = "ID: 281"]
13368#[derive(Debug, Clone, PartialEq)]
13369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13371#[cfg_attr(feature = "ts", derive(TS))]
13372#[cfg_attr(feature = "ts", ts(export))]
13373pub struct GIMBAL_MANAGER_STATUS_DATA {
13374 #[doc = "Timestamp (time since system boot)."]
13375 pub time_boot_ms: u32,
13376 #[doc = "High level gimbal manager flags currently applied."]
13377 pub flags: GimbalManagerFlags,
13378 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13379 pub gimbal_device_id: u8,
13380 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13381 pub primary_control_sysid: u8,
13382 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13383 pub primary_control_compid: u8,
13384 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13385 pub secondary_control_sysid: u8,
13386 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13387 pub secondary_control_compid: u8,
13388}
13389impl GIMBAL_MANAGER_STATUS_DATA {
13390 pub const ENCODED_LEN: usize = 13usize;
13391 pub const DEFAULT: Self = Self {
13392 time_boot_ms: 0_u32,
13393 flags: GimbalManagerFlags::DEFAULT,
13394 gimbal_device_id: 0_u8,
13395 primary_control_sysid: 0_u8,
13396 primary_control_compid: 0_u8,
13397 secondary_control_sysid: 0_u8,
13398 secondary_control_compid: 0_u8,
13399 };
13400 #[cfg(feature = "arbitrary")]
13401 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13402 use arbitrary::{Arbitrary, Unstructured};
13403 let mut buf = [0u8; 1024];
13404 rng.fill_bytes(&mut buf);
13405 let mut unstructured = Unstructured::new(&buf);
13406 Self::arbitrary(&mut unstructured).unwrap_or_default()
13407 }
13408}
13409impl Default for GIMBAL_MANAGER_STATUS_DATA {
13410 fn default() -> Self {
13411 Self::DEFAULT.clone()
13412 }
13413}
13414impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13415 type Message = MavMessage;
13416 const ID: u32 = 281u32;
13417 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13418 const EXTRA_CRC: u8 = 48u8;
13419 const ENCODED_LEN: usize = 13usize;
13420 fn deser(
13421 _version: MavlinkVersion,
13422 __input: &[u8],
13423 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13424 let avail_len = __input.len();
13425 let mut payload_buf = [0; Self::ENCODED_LEN];
13426 let mut buf = if avail_len < Self::ENCODED_LEN {
13427 payload_buf[0..avail_len].copy_from_slice(__input);
13428 Bytes::new(&payload_buf)
13429 } else {
13430 Bytes::new(__input)
13431 };
13432 let mut __struct = Self::default();
13433 __struct.time_boot_ms = buf.get_u32_le()?;
13434 let tmp = buf.get_u32_le()?;
13435 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13436 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13437 flag_type: "GimbalManagerFlags",
13438 value: tmp as u64,
13439 })?;
13440 __struct.gimbal_device_id = buf.get_u8()?;
13441 __struct.primary_control_sysid = buf.get_u8()?;
13442 __struct.primary_control_compid = buf.get_u8()?;
13443 __struct.secondary_control_sysid = buf.get_u8()?;
13444 __struct.secondary_control_compid = buf.get_u8()?;
13445 Ok(__struct)
13446 }
13447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13448 let mut __tmp = BytesMut::new(bytes);
13449 #[allow(clippy::absurd_extreme_comparisons)]
13450 #[allow(unused_comparisons)]
13451 if __tmp.remaining() < Self::ENCODED_LEN {
13452 panic!(
13453 "buffer is too small (need {} bytes, but got {})",
13454 Self::ENCODED_LEN,
13455 __tmp.remaining(),
13456 )
13457 }
13458 __tmp.put_u32_le(self.time_boot_ms);
13459 __tmp.put_u32_le(self.flags.bits() as u32);
13460 __tmp.put_u8(self.gimbal_device_id);
13461 __tmp.put_u8(self.primary_control_sysid);
13462 __tmp.put_u8(self.primary_control_compid);
13463 __tmp.put_u8(self.secondary_control_sysid);
13464 __tmp.put_u8(self.secondary_control_compid);
13465 if matches!(version, MavlinkVersion::V2) {
13466 let len = __tmp.len();
13467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13468 } else {
13469 __tmp.len()
13470 }
13471 }
13472}
13473#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13474#[doc = ""]
13475#[doc = "ID: 33"]
13476#[derive(Debug, Clone, PartialEq)]
13477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13479#[cfg_attr(feature = "ts", derive(TS))]
13480#[cfg_attr(feature = "ts", ts(export))]
13481pub struct GLOBAL_POSITION_INT_DATA {
13482 #[doc = "Timestamp (time since system boot)."]
13483 pub time_boot_ms: u32,
13484 #[doc = "Latitude, expressed"]
13485 pub lat: i32,
13486 #[doc = "Longitude, expressed"]
13487 pub lon: i32,
13488 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13489 pub alt: i32,
13490 #[doc = "Altitude above home"]
13491 pub relative_alt: i32,
13492 #[doc = "Ground X Speed (Latitude, positive north)"]
13493 pub vx: i16,
13494 #[doc = "Ground Y Speed (Longitude, positive east)"]
13495 pub vy: i16,
13496 #[doc = "Ground Z Speed (Altitude, positive down)"]
13497 pub vz: i16,
13498 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13499 pub hdg: u16,
13500}
13501impl GLOBAL_POSITION_INT_DATA {
13502 pub const ENCODED_LEN: usize = 28usize;
13503 pub const DEFAULT: Self = Self {
13504 time_boot_ms: 0_u32,
13505 lat: 0_i32,
13506 lon: 0_i32,
13507 alt: 0_i32,
13508 relative_alt: 0_i32,
13509 vx: 0_i16,
13510 vy: 0_i16,
13511 vz: 0_i16,
13512 hdg: 0_u16,
13513 };
13514 #[cfg(feature = "arbitrary")]
13515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13516 use arbitrary::{Arbitrary, Unstructured};
13517 let mut buf = [0u8; 1024];
13518 rng.fill_bytes(&mut buf);
13519 let mut unstructured = Unstructured::new(&buf);
13520 Self::arbitrary(&mut unstructured).unwrap_or_default()
13521 }
13522}
13523impl Default for GLOBAL_POSITION_INT_DATA {
13524 fn default() -> Self {
13525 Self::DEFAULT.clone()
13526 }
13527}
13528impl MessageData for GLOBAL_POSITION_INT_DATA {
13529 type Message = MavMessage;
13530 const ID: u32 = 33u32;
13531 const NAME: &'static str = "GLOBAL_POSITION_INT";
13532 const EXTRA_CRC: u8 = 104u8;
13533 const ENCODED_LEN: usize = 28usize;
13534 fn deser(
13535 _version: MavlinkVersion,
13536 __input: &[u8],
13537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13538 let avail_len = __input.len();
13539 let mut payload_buf = [0; Self::ENCODED_LEN];
13540 let mut buf = if avail_len < Self::ENCODED_LEN {
13541 payload_buf[0..avail_len].copy_from_slice(__input);
13542 Bytes::new(&payload_buf)
13543 } else {
13544 Bytes::new(__input)
13545 };
13546 let mut __struct = Self::default();
13547 __struct.time_boot_ms = buf.get_u32_le()?;
13548 __struct.lat = buf.get_i32_le()?;
13549 __struct.lon = buf.get_i32_le()?;
13550 __struct.alt = buf.get_i32_le()?;
13551 __struct.relative_alt = buf.get_i32_le()?;
13552 __struct.vx = buf.get_i16_le()?;
13553 __struct.vy = buf.get_i16_le()?;
13554 __struct.vz = buf.get_i16_le()?;
13555 __struct.hdg = buf.get_u16_le()?;
13556 Ok(__struct)
13557 }
13558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13559 let mut __tmp = BytesMut::new(bytes);
13560 #[allow(clippy::absurd_extreme_comparisons)]
13561 #[allow(unused_comparisons)]
13562 if __tmp.remaining() < Self::ENCODED_LEN {
13563 panic!(
13564 "buffer is too small (need {} bytes, but got {})",
13565 Self::ENCODED_LEN,
13566 __tmp.remaining(),
13567 )
13568 }
13569 __tmp.put_u32_le(self.time_boot_ms);
13570 __tmp.put_i32_le(self.lat);
13571 __tmp.put_i32_le(self.lon);
13572 __tmp.put_i32_le(self.alt);
13573 __tmp.put_i32_le(self.relative_alt);
13574 __tmp.put_i16_le(self.vx);
13575 __tmp.put_i16_le(self.vy);
13576 __tmp.put_i16_le(self.vz);
13577 __tmp.put_u16_le(self.hdg);
13578 if matches!(version, MavlinkVersion::V2) {
13579 let len = __tmp.len();
13580 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13581 } else {
13582 __tmp.len()
13583 }
13584 }
13585}
13586#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13587#[doc = ""]
13588#[doc = "ID: 63"]
13589#[derive(Debug, Clone, PartialEq)]
13590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13592#[cfg_attr(feature = "ts", derive(TS))]
13593#[cfg_attr(feature = "ts", ts(export))]
13594pub struct GLOBAL_POSITION_INT_COV_DATA {
13595 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13596 pub time_usec: u64,
13597 #[doc = "Latitude"]
13598 pub lat: i32,
13599 #[doc = "Longitude"]
13600 pub lon: i32,
13601 #[doc = "Altitude in meters above MSL"]
13602 pub alt: i32,
13603 #[doc = "Altitude above ground"]
13604 pub relative_alt: i32,
13605 #[doc = "Ground X Speed (Latitude)"]
13606 pub vx: f32,
13607 #[doc = "Ground Y Speed (Longitude)"]
13608 pub vy: f32,
13609 #[doc = "Ground Z Speed (Altitude)"]
13610 pub vz: f32,
13611 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13612 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13613 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13614 pub covariance: [f32; 36],
13615 #[doc = "Class id of the estimator this estimate originated from."]
13616 pub estimator_type: MavEstimatorType,
13617}
13618impl GLOBAL_POSITION_INT_COV_DATA {
13619 pub const ENCODED_LEN: usize = 181usize;
13620 pub const DEFAULT: Self = Self {
13621 time_usec: 0_u64,
13622 lat: 0_i32,
13623 lon: 0_i32,
13624 alt: 0_i32,
13625 relative_alt: 0_i32,
13626 vx: 0.0_f32,
13627 vy: 0.0_f32,
13628 vz: 0.0_f32,
13629 covariance: [0.0_f32; 36usize],
13630 estimator_type: MavEstimatorType::DEFAULT,
13631 };
13632 #[cfg(feature = "arbitrary")]
13633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13634 use arbitrary::{Arbitrary, Unstructured};
13635 let mut buf = [0u8; 1024];
13636 rng.fill_bytes(&mut buf);
13637 let mut unstructured = Unstructured::new(&buf);
13638 Self::arbitrary(&mut unstructured).unwrap_or_default()
13639 }
13640}
13641impl Default for GLOBAL_POSITION_INT_COV_DATA {
13642 fn default() -> Self {
13643 Self::DEFAULT.clone()
13644 }
13645}
13646impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13647 type Message = MavMessage;
13648 const ID: u32 = 63u32;
13649 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13650 const EXTRA_CRC: u8 = 119u8;
13651 const ENCODED_LEN: usize = 181usize;
13652 fn deser(
13653 _version: MavlinkVersion,
13654 __input: &[u8],
13655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13656 let avail_len = __input.len();
13657 let mut payload_buf = [0; Self::ENCODED_LEN];
13658 let mut buf = if avail_len < Self::ENCODED_LEN {
13659 payload_buf[0..avail_len].copy_from_slice(__input);
13660 Bytes::new(&payload_buf)
13661 } else {
13662 Bytes::new(__input)
13663 };
13664 let mut __struct = Self::default();
13665 __struct.time_usec = buf.get_u64_le()?;
13666 __struct.lat = buf.get_i32_le()?;
13667 __struct.lon = buf.get_i32_le()?;
13668 __struct.alt = buf.get_i32_le()?;
13669 __struct.relative_alt = buf.get_i32_le()?;
13670 __struct.vx = buf.get_f32_le()?;
13671 __struct.vy = buf.get_f32_le()?;
13672 __struct.vz = buf.get_f32_le()?;
13673 for v in &mut __struct.covariance {
13674 let val = buf.get_f32_le()?;
13675 *v = val;
13676 }
13677 let tmp = buf.get_u8()?;
13678 __struct.estimator_type =
13679 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13680 enum_type: "MavEstimatorType",
13681 value: tmp as u64,
13682 })?;
13683 Ok(__struct)
13684 }
13685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13686 let mut __tmp = BytesMut::new(bytes);
13687 #[allow(clippy::absurd_extreme_comparisons)]
13688 #[allow(unused_comparisons)]
13689 if __tmp.remaining() < Self::ENCODED_LEN {
13690 panic!(
13691 "buffer is too small (need {} bytes, but got {})",
13692 Self::ENCODED_LEN,
13693 __tmp.remaining(),
13694 )
13695 }
13696 __tmp.put_u64_le(self.time_usec);
13697 __tmp.put_i32_le(self.lat);
13698 __tmp.put_i32_le(self.lon);
13699 __tmp.put_i32_le(self.alt);
13700 __tmp.put_i32_le(self.relative_alt);
13701 __tmp.put_f32_le(self.vx);
13702 __tmp.put_f32_le(self.vy);
13703 __tmp.put_f32_le(self.vz);
13704 for val in &self.covariance {
13705 __tmp.put_f32_le(*val);
13706 }
13707 __tmp.put_u8(self.estimator_type as u8);
13708 if matches!(version, MavlinkVersion::V2) {
13709 let len = __tmp.len();
13710 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13711 } else {
13712 __tmp.len()
13713 }
13714 }
13715}
13716#[doc = "Global position/attitude estimate from a vision source."]
13717#[doc = ""]
13718#[doc = "ID: 101"]
13719#[derive(Debug, Clone, PartialEq)]
13720#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13722#[cfg_attr(feature = "ts", derive(TS))]
13723#[cfg_attr(feature = "ts", ts(export))]
13724pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13725 #[doc = "Timestamp (UNIX time or since system boot)"]
13726 pub usec: u64,
13727 #[doc = "Global X position"]
13728 pub x: f32,
13729 #[doc = "Global Y position"]
13730 pub y: f32,
13731 #[doc = "Global Z position"]
13732 pub z: f32,
13733 #[doc = "Roll angle"]
13734 pub roll: f32,
13735 #[doc = "Pitch angle"]
13736 pub pitch: f32,
13737 #[doc = "Yaw angle"]
13738 pub yaw: f32,
13739 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13740 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13741 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13742 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13743 pub covariance: [f32; 21],
13744 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13746 pub reset_counter: u8,
13747}
13748impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13749 pub const ENCODED_LEN: usize = 117usize;
13750 pub const DEFAULT: Self = Self {
13751 usec: 0_u64,
13752 x: 0.0_f32,
13753 y: 0.0_f32,
13754 z: 0.0_f32,
13755 roll: 0.0_f32,
13756 pitch: 0.0_f32,
13757 yaw: 0.0_f32,
13758 covariance: [0.0_f32; 21usize],
13759 reset_counter: 0_u8,
13760 };
13761 #[cfg(feature = "arbitrary")]
13762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13763 use arbitrary::{Arbitrary, Unstructured};
13764 let mut buf = [0u8; 1024];
13765 rng.fill_bytes(&mut buf);
13766 let mut unstructured = Unstructured::new(&buf);
13767 Self::arbitrary(&mut unstructured).unwrap_or_default()
13768 }
13769}
13770impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13771 fn default() -> Self {
13772 Self::DEFAULT.clone()
13773 }
13774}
13775impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13776 type Message = MavMessage;
13777 const ID: u32 = 101u32;
13778 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13779 const EXTRA_CRC: u8 = 102u8;
13780 const ENCODED_LEN: usize = 117usize;
13781 fn deser(
13782 _version: MavlinkVersion,
13783 __input: &[u8],
13784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13785 let avail_len = __input.len();
13786 let mut payload_buf = [0; Self::ENCODED_LEN];
13787 let mut buf = if avail_len < Self::ENCODED_LEN {
13788 payload_buf[0..avail_len].copy_from_slice(__input);
13789 Bytes::new(&payload_buf)
13790 } else {
13791 Bytes::new(__input)
13792 };
13793 let mut __struct = Self::default();
13794 __struct.usec = buf.get_u64_le()?;
13795 __struct.x = buf.get_f32_le()?;
13796 __struct.y = buf.get_f32_le()?;
13797 __struct.z = buf.get_f32_le()?;
13798 __struct.roll = buf.get_f32_le()?;
13799 __struct.pitch = buf.get_f32_le()?;
13800 __struct.yaw = buf.get_f32_le()?;
13801 for v in &mut __struct.covariance {
13802 let val = buf.get_f32_le()?;
13803 *v = val;
13804 }
13805 __struct.reset_counter = buf.get_u8()?;
13806 Ok(__struct)
13807 }
13808 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13809 let mut __tmp = BytesMut::new(bytes);
13810 #[allow(clippy::absurd_extreme_comparisons)]
13811 #[allow(unused_comparisons)]
13812 if __tmp.remaining() < Self::ENCODED_LEN {
13813 panic!(
13814 "buffer is too small (need {} bytes, but got {})",
13815 Self::ENCODED_LEN,
13816 __tmp.remaining(),
13817 )
13818 }
13819 __tmp.put_u64_le(self.usec);
13820 __tmp.put_f32_le(self.x);
13821 __tmp.put_f32_le(self.y);
13822 __tmp.put_f32_le(self.z);
13823 __tmp.put_f32_le(self.roll);
13824 __tmp.put_f32_le(self.pitch);
13825 __tmp.put_f32_le(self.yaw);
13826 if matches!(version, MavlinkVersion::V2) {
13827 for val in &self.covariance {
13828 __tmp.put_f32_le(*val);
13829 }
13830 __tmp.put_u8(self.reset_counter);
13831 let len = __tmp.len();
13832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13833 } else {
13834 __tmp.len()
13835 }
13836 }
13837}
13838#[doc = "Second GPS data."]
13839#[doc = ""]
13840#[doc = "ID: 124"]
13841#[derive(Debug, Clone, PartialEq)]
13842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13844#[cfg_attr(feature = "ts", derive(TS))]
13845#[cfg_attr(feature = "ts", ts(export))]
13846pub struct GPS2_RAW_DATA {
13847 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13848 pub time_usec: u64,
13849 #[doc = "Latitude (WGS84)"]
13850 pub lat: i32,
13851 #[doc = "Longitude (WGS84)"]
13852 pub lon: i32,
13853 #[doc = "Altitude (MSL). Positive for up."]
13854 pub alt: i32,
13855 #[doc = "Age of DGPS info"]
13856 pub dgps_age: u32,
13857 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13858 pub eph: u16,
13859 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13860 pub epv: u16,
13861 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13862 pub vel: u16,
13863 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13864 pub cog: u16,
13865 #[doc = "GPS fix type."]
13866 pub fix_type: GpsFixType,
13867 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13868 pub satellites_visible: u8,
13869 #[doc = "Number of DGPS satellites"]
13870 pub dgps_numch: u8,
13871 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13872 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13873 pub yaw: u16,
13874 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13875 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13876 pub alt_ellipsoid: i32,
13877 #[doc = "Position uncertainty."]
13878 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13879 pub h_acc: u32,
13880 #[doc = "Altitude uncertainty."]
13881 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13882 pub v_acc: u32,
13883 #[doc = "Speed uncertainty."]
13884 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13885 pub vel_acc: u32,
13886 #[doc = "Heading / track uncertainty"]
13887 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13888 pub hdg_acc: u32,
13889}
13890impl GPS2_RAW_DATA {
13891 pub const ENCODED_LEN: usize = 57usize;
13892 pub const DEFAULT: Self = Self {
13893 time_usec: 0_u64,
13894 lat: 0_i32,
13895 lon: 0_i32,
13896 alt: 0_i32,
13897 dgps_age: 0_u32,
13898 eph: 0_u16,
13899 epv: 0_u16,
13900 vel: 0_u16,
13901 cog: 0_u16,
13902 fix_type: GpsFixType::DEFAULT,
13903 satellites_visible: 0_u8,
13904 dgps_numch: 0_u8,
13905 yaw: 0_u16,
13906 alt_ellipsoid: 0_i32,
13907 h_acc: 0_u32,
13908 v_acc: 0_u32,
13909 vel_acc: 0_u32,
13910 hdg_acc: 0_u32,
13911 };
13912 #[cfg(feature = "arbitrary")]
13913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13914 use arbitrary::{Arbitrary, Unstructured};
13915 let mut buf = [0u8; 1024];
13916 rng.fill_bytes(&mut buf);
13917 let mut unstructured = Unstructured::new(&buf);
13918 Self::arbitrary(&mut unstructured).unwrap_or_default()
13919 }
13920}
13921impl Default for GPS2_RAW_DATA {
13922 fn default() -> Self {
13923 Self::DEFAULT.clone()
13924 }
13925}
13926impl MessageData for GPS2_RAW_DATA {
13927 type Message = MavMessage;
13928 const ID: u32 = 124u32;
13929 const NAME: &'static str = "GPS2_RAW";
13930 const EXTRA_CRC: u8 = 87u8;
13931 const ENCODED_LEN: usize = 57usize;
13932 fn deser(
13933 _version: MavlinkVersion,
13934 __input: &[u8],
13935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13936 let avail_len = __input.len();
13937 let mut payload_buf = [0; Self::ENCODED_LEN];
13938 let mut buf = if avail_len < Self::ENCODED_LEN {
13939 payload_buf[0..avail_len].copy_from_slice(__input);
13940 Bytes::new(&payload_buf)
13941 } else {
13942 Bytes::new(__input)
13943 };
13944 let mut __struct = Self::default();
13945 __struct.time_usec = buf.get_u64_le()?;
13946 __struct.lat = buf.get_i32_le()?;
13947 __struct.lon = buf.get_i32_le()?;
13948 __struct.alt = buf.get_i32_le()?;
13949 __struct.dgps_age = buf.get_u32_le()?;
13950 __struct.eph = buf.get_u16_le()?;
13951 __struct.epv = buf.get_u16_le()?;
13952 __struct.vel = buf.get_u16_le()?;
13953 __struct.cog = buf.get_u16_le()?;
13954 let tmp = buf.get_u8()?;
13955 __struct.fix_type =
13956 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13957 enum_type: "GpsFixType",
13958 value: tmp as u64,
13959 })?;
13960 __struct.satellites_visible = buf.get_u8()?;
13961 __struct.dgps_numch = buf.get_u8()?;
13962 __struct.yaw = buf.get_u16_le()?;
13963 __struct.alt_ellipsoid = buf.get_i32_le()?;
13964 __struct.h_acc = buf.get_u32_le()?;
13965 __struct.v_acc = buf.get_u32_le()?;
13966 __struct.vel_acc = buf.get_u32_le()?;
13967 __struct.hdg_acc = buf.get_u32_le()?;
13968 Ok(__struct)
13969 }
13970 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13971 let mut __tmp = BytesMut::new(bytes);
13972 #[allow(clippy::absurd_extreme_comparisons)]
13973 #[allow(unused_comparisons)]
13974 if __tmp.remaining() < Self::ENCODED_LEN {
13975 panic!(
13976 "buffer is too small (need {} bytes, but got {})",
13977 Self::ENCODED_LEN,
13978 __tmp.remaining(),
13979 )
13980 }
13981 __tmp.put_u64_le(self.time_usec);
13982 __tmp.put_i32_le(self.lat);
13983 __tmp.put_i32_le(self.lon);
13984 __tmp.put_i32_le(self.alt);
13985 __tmp.put_u32_le(self.dgps_age);
13986 __tmp.put_u16_le(self.eph);
13987 __tmp.put_u16_le(self.epv);
13988 __tmp.put_u16_le(self.vel);
13989 __tmp.put_u16_le(self.cog);
13990 __tmp.put_u8(self.fix_type as u8);
13991 __tmp.put_u8(self.satellites_visible);
13992 __tmp.put_u8(self.dgps_numch);
13993 if matches!(version, MavlinkVersion::V2) {
13994 __tmp.put_u16_le(self.yaw);
13995 __tmp.put_i32_le(self.alt_ellipsoid);
13996 __tmp.put_u32_le(self.h_acc);
13997 __tmp.put_u32_le(self.v_acc);
13998 __tmp.put_u32_le(self.vel_acc);
13999 __tmp.put_u32_le(self.hdg_acc);
14000 let len = __tmp.len();
14001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14002 } else {
14003 __tmp.len()
14004 }
14005 }
14006}
14007#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14008#[doc = ""]
14009#[doc = "ID: 128"]
14010#[derive(Debug, Clone, PartialEq)]
14011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14013#[cfg_attr(feature = "ts", derive(TS))]
14014#[cfg_attr(feature = "ts", ts(export))]
14015pub struct GPS2_RTK_DATA {
14016 #[doc = "Time since boot of last baseline message received."]
14017 pub time_last_baseline_ms: u32,
14018 #[doc = "GPS Time of Week of last baseline"]
14019 pub tow: u32,
14020 #[doc = "Current baseline in ECEF x or NED north component."]
14021 pub baseline_a_mm: i32,
14022 #[doc = "Current baseline in ECEF y or NED east component."]
14023 pub baseline_b_mm: i32,
14024 #[doc = "Current baseline in ECEF z or NED down component."]
14025 pub baseline_c_mm: i32,
14026 #[doc = "Current estimate of baseline accuracy."]
14027 pub accuracy: u32,
14028 #[doc = "Current number of integer ambiguity hypotheses."]
14029 pub iar_num_hypotheses: i32,
14030 #[doc = "GPS Week Number of last baseline"]
14031 pub wn: u16,
14032 #[doc = "Identification of connected RTK receiver."]
14033 pub rtk_receiver_id: u8,
14034 #[doc = "GPS-specific health report for RTK data."]
14035 pub rtk_health: u8,
14036 #[doc = "Rate of baseline messages being received by GPS"]
14037 pub rtk_rate: u8,
14038 #[doc = "Current number of sats used for RTK calculation."]
14039 pub nsats: u8,
14040 #[doc = "Coordinate system of baseline"]
14041 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14042}
14043impl GPS2_RTK_DATA {
14044 pub const ENCODED_LEN: usize = 35usize;
14045 pub const DEFAULT: Self = Self {
14046 time_last_baseline_ms: 0_u32,
14047 tow: 0_u32,
14048 baseline_a_mm: 0_i32,
14049 baseline_b_mm: 0_i32,
14050 baseline_c_mm: 0_i32,
14051 accuracy: 0_u32,
14052 iar_num_hypotheses: 0_i32,
14053 wn: 0_u16,
14054 rtk_receiver_id: 0_u8,
14055 rtk_health: 0_u8,
14056 rtk_rate: 0_u8,
14057 nsats: 0_u8,
14058 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14059 };
14060 #[cfg(feature = "arbitrary")]
14061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14062 use arbitrary::{Arbitrary, Unstructured};
14063 let mut buf = [0u8; 1024];
14064 rng.fill_bytes(&mut buf);
14065 let mut unstructured = Unstructured::new(&buf);
14066 Self::arbitrary(&mut unstructured).unwrap_or_default()
14067 }
14068}
14069impl Default for GPS2_RTK_DATA {
14070 fn default() -> Self {
14071 Self::DEFAULT.clone()
14072 }
14073}
14074impl MessageData for GPS2_RTK_DATA {
14075 type Message = MavMessage;
14076 const ID: u32 = 128u32;
14077 const NAME: &'static str = "GPS2_RTK";
14078 const EXTRA_CRC: u8 = 226u8;
14079 const ENCODED_LEN: usize = 35usize;
14080 fn deser(
14081 _version: MavlinkVersion,
14082 __input: &[u8],
14083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14084 let avail_len = __input.len();
14085 let mut payload_buf = [0; Self::ENCODED_LEN];
14086 let mut buf = if avail_len < Self::ENCODED_LEN {
14087 payload_buf[0..avail_len].copy_from_slice(__input);
14088 Bytes::new(&payload_buf)
14089 } else {
14090 Bytes::new(__input)
14091 };
14092 let mut __struct = Self::default();
14093 __struct.time_last_baseline_ms = buf.get_u32_le()?;
14094 __struct.tow = buf.get_u32_le()?;
14095 __struct.baseline_a_mm = buf.get_i32_le()?;
14096 __struct.baseline_b_mm = buf.get_i32_le()?;
14097 __struct.baseline_c_mm = buf.get_i32_le()?;
14098 __struct.accuracy = buf.get_u32_le()?;
14099 __struct.iar_num_hypotheses = buf.get_i32_le()?;
14100 __struct.wn = buf.get_u16_le()?;
14101 __struct.rtk_receiver_id = buf.get_u8()?;
14102 __struct.rtk_health = buf.get_u8()?;
14103 __struct.rtk_rate = buf.get_u8()?;
14104 __struct.nsats = buf.get_u8()?;
14105 let tmp = buf.get_u8()?;
14106 __struct.baseline_coords_type =
14107 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14108 enum_type: "RtkBaselineCoordinateSystem",
14109 value: tmp as u64,
14110 })?;
14111 Ok(__struct)
14112 }
14113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14114 let mut __tmp = BytesMut::new(bytes);
14115 #[allow(clippy::absurd_extreme_comparisons)]
14116 #[allow(unused_comparisons)]
14117 if __tmp.remaining() < Self::ENCODED_LEN {
14118 panic!(
14119 "buffer is too small (need {} bytes, but got {})",
14120 Self::ENCODED_LEN,
14121 __tmp.remaining(),
14122 )
14123 }
14124 __tmp.put_u32_le(self.time_last_baseline_ms);
14125 __tmp.put_u32_le(self.tow);
14126 __tmp.put_i32_le(self.baseline_a_mm);
14127 __tmp.put_i32_le(self.baseline_b_mm);
14128 __tmp.put_i32_le(self.baseline_c_mm);
14129 __tmp.put_u32_le(self.accuracy);
14130 __tmp.put_i32_le(self.iar_num_hypotheses);
14131 __tmp.put_u16_le(self.wn);
14132 __tmp.put_u8(self.rtk_receiver_id);
14133 __tmp.put_u8(self.rtk_health);
14134 __tmp.put_u8(self.rtk_rate);
14135 __tmp.put_u8(self.nsats);
14136 __tmp.put_u8(self.baseline_coords_type as u8);
14137 if matches!(version, MavlinkVersion::V2) {
14138 let len = __tmp.len();
14139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14140 } else {
14141 __tmp.len()
14142 }
14143 }
14144}
14145#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14146#[doc = ""]
14147#[doc = "ID: 49"]
14148#[derive(Debug, Clone, PartialEq)]
14149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14151#[cfg_attr(feature = "ts", derive(TS))]
14152#[cfg_attr(feature = "ts", ts(export))]
14153pub struct GPS_GLOBAL_ORIGIN_DATA {
14154 #[doc = "Latitude (WGS84)"]
14155 pub latitude: i32,
14156 #[doc = "Longitude (WGS84)"]
14157 pub longitude: i32,
14158 #[doc = "Altitude (MSL). Positive for up."]
14159 pub altitude: i32,
14160 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14161 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14162 pub time_usec: u64,
14163}
14164impl GPS_GLOBAL_ORIGIN_DATA {
14165 pub const ENCODED_LEN: usize = 20usize;
14166 pub const DEFAULT: Self = Self {
14167 latitude: 0_i32,
14168 longitude: 0_i32,
14169 altitude: 0_i32,
14170 time_usec: 0_u64,
14171 };
14172 #[cfg(feature = "arbitrary")]
14173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14174 use arbitrary::{Arbitrary, Unstructured};
14175 let mut buf = [0u8; 1024];
14176 rng.fill_bytes(&mut buf);
14177 let mut unstructured = Unstructured::new(&buf);
14178 Self::arbitrary(&mut unstructured).unwrap_or_default()
14179 }
14180}
14181impl Default for GPS_GLOBAL_ORIGIN_DATA {
14182 fn default() -> Self {
14183 Self::DEFAULT.clone()
14184 }
14185}
14186impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14187 type Message = MavMessage;
14188 const ID: u32 = 49u32;
14189 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14190 const EXTRA_CRC: u8 = 39u8;
14191 const ENCODED_LEN: usize = 20usize;
14192 fn deser(
14193 _version: MavlinkVersion,
14194 __input: &[u8],
14195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14196 let avail_len = __input.len();
14197 let mut payload_buf = [0; Self::ENCODED_LEN];
14198 let mut buf = if avail_len < Self::ENCODED_LEN {
14199 payload_buf[0..avail_len].copy_from_slice(__input);
14200 Bytes::new(&payload_buf)
14201 } else {
14202 Bytes::new(__input)
14203 };
14204 let mut __struct = Self::default();
14205 __struct.latitude = buf.get_i32_le()?;
14206 __struct.longitude = buf.get_i32_le()?;
14207 __struct.altitude = buf.get_i32_le()?;
14208 __struct.time_usec = buf.get_u64_le()?;
14209 Ok(__struct)
14210 }
14211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14212 let mut __tmp = BytesMut::new(bytes);
14213 #[allow(clippy::absurd_extreme_comparisons)]
14214 #[allow(unused_comparisons)]
14215 if __tmp.remaining() < Self::ENCODED_LEN {
14216 panic!(
14217 "buffer is too small (need {} bytes, but got {})",
14218 Self::ENCODED_LEN,
14219 __tmp.remaining(),
14220 )
14221 }
14222 __tmp.put_i32_le(self.latitude);
14223 __tmp.put_i32_le(self.longitude);
14224 __tmp.put_i32_le(self.altitude);
14225 if matches!(version, MavlinkVersion::V2) {
14226 __tmp.put_u64_le(self.time_usec);
14227 let len = __tmp.len();
14228 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14229 } else {
14230 __tmp.len()
14231 }
14232 }
14233}
14234#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14235#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14236#[doc = ""]
14237#[doc = "ID: 123"]
14238#[derive(Debug, Clone, PartialEq)]
14239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14241#[cfg_attr(feature = "ts", derive(TS))]
14242#[cfg_attr(feature = "ts", ts(export))]
14243pub struct GPS_INJECT_DATA_DATA {
14244 #[doc = "System ID"]
14245 pub target_system: u8,
14246 #[doc = "Component ID"]
14247 pub target_component: u8,
14248 #[doc = "Data length"]
14249 pub len: u8,
14250 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14252 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14253 pub data: [u8; 110],
14254}
14255impl GPS_INJECT_DATA_DATA {
14256 pub const ENCODED_LEN: usize = 113usize;
14257 pub const DEFAULT: Self = Self {
14258 target_system: 0_u8,
14259 target_component: 0_u8,
14260 len: 0_u8,
14261 data: [0_u8; 110usize],
14262 };
14263 #[cfg(feature = "arbitrary")]
14264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14265 use arbitrary::{Arbitrary, Unstructured};
14266 let mut buf = [0u8; 1024];
14267 rng.fill_bytes(&mut buf);
14268 let mut unstructured = Unstructured::new(&buf);
14269 Self::arbitrary(&mut unstructured).unwrap_or_default()
14270 }
14271}
14272impl Default for GPS_INJECT_DATA_DATA {
14273 fn default() -> Self {
14274 Self::DEFAULT.clone()
14275 }
14276}
14277impl MessageData for GPS_INJECT_DATA_DATA {
14278 type Message = MavMessage;
14279 const ID: u32 = 123u32;
14280 const NAME: &'static str = "GPS_INJECT_DATA";
14281 const EXTRA_CRC: u8 = 250u8;
14282 const ENCODED_LEN: usize = 113usize;
14283 fn deser(
14284 _version: MavlinkVersion,
14285 __input: &[u8],
14286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14287 let avail_len = __input.len();
14288 let mut payload_buf = [0; Self::ENCODED_LEN];
14289 let mut buf = if avail_len < Self::ENCODED_LEN {
14290 payload_buf[0..avail_len].copy_from_slice(__input);
14291 Bytes::new(&payload_buf)
14292 } else {
14293 Bytes::new(__input)
14294 };
14295 let mut __struct = Self::default();
14296 __struct.target_system = buf.get_u8()?;
14297 __struct.target_component = buf.get_u8()?;
14298 __struct.len = buf.get_u8()?;
14299 for v in &mut __struct.data {
14300 let val = buf.get_u8()?;
14301 *v = val;
14302 }
14303 Ok(__struct)
14304 }
14305 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14306 let mut __tmp = BytesMut::new(bytes);
14307 #[allow(clippy::absurd_extreme_comparisons)]
14308 #[allow(unused_comparisons)]
14309 if __tmp.remaining() < Self::ENCODED_LEN {
14310 panic!(
14311 "buffer is too small (need {} bytes, but got {})",
14312 Self::ENCODED_LEN,
14313 __tmp.remaining(),
14314 )
14315 }
14316 __tmp.put_u8(self.target_system);
14317 __tmp.put_u8(self.target_component);
14318 __tmp.put_u8(self.len);
14319 for val in &self.data {
14320 __tmp.put_u8(*val);
14321 }
14322 if matches!(version, MavlinkVersion::V2) {
14323 let len = __tmp.len();
14324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14325 } else {
14326 __tmp.len()
14327 }
14328 }
14329}
14330#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14331#[doc = ""]
14332#[doc = "ID: 232"]
14333#[derive(Debug, Clone, PartialEq)]
14334#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14336#[cfg_attr(feature = "ts", derive(TS))]
14337#[cfg_attr(feature = "ts", ts(export))]
14338pub struct GPS_INPUT_DATA {
14339 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14340 pub time_usec: u64,
14341 #[doc = "GPS time (from start of GPS week)"]
14342 pub time_week_ms: u32,
14343 #[doc = "Latitude (WGS84)"]
14344 pub lat: i32,
14345 #[doc = "Longitude (WGS84)"]
14346 pub lon: i32,
14347 #[doc = "Altitude (MSL). Positive for up."]
14348 pub alt: f32,
14349 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14350 pub hdop: f32,
14351 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14352 pub vdop: f32,
14353 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14354 pub vn: f32,
14355 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14356 pub ve: f32,
14357 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14358 pub vd: f32,
14359 #[doc = "GPS speed accuracy"]
14360 pub speed_accuracy: f32,
14361 #[doc = "GPS horizontal accuracy"]
14362 pub horiz_accuracy: f32,
14363 #[doc = "GPS vertical accuracy"]
14364 pub vert_accuracy: f32,
14365 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14366 pub ignore_flags: GpsInputIgnoreFlags,
14367 #[doc = "GPS week number"]
14368 pub time_week: u16,
14369 #[doc = "ID of the GPS for multiple GPS inputs"]
14370 pub gps_id: u8,
14371 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14372 pub fix_type: u8,
14373 #[doc = "Number of satellites visible."]
14374 pub satellites_visible: u8,
14375 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14376 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14377 pub yaw: u16,
14378}
14379impl GPS_INPUT_DATA {
14380 pub const ENCODED_LEN: usize = 65usize;
14381 pub const DEFAULT: Self = Self {
14382 time_usec: 0_u64,
14383 time_week_ms: 0_u32,
14384 lat: 0_i32,
14385 lon: 0_i32,
14386 alt: 0.0_f32,
14387 hdop: 0.0_f32,
14388 vdop: 0.0_f32,
14389 vn: 0.0_f32,
14390 ve: 0.0_f32,
14391 vd: 0.0_f32,
14392 speed_accuracy: 0.0_f32,
14393 horiz_accuracy: 0.0_f32,
14394 vert_accuracy: 0.0_f32,
14395 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14396 time_week: 0_u16,
14397 gps_id: 0_u8,
14398 fix_type: 0_u8,
14399 satellites_visible: 0_u8,
14400 yaw: 0_u16,
14401 };
14402 #[cfg(feature = "arbitrary")]
14403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14404 use arbitrary::{Arbitrary, Unstructured};
14405 let mut buf = [0u8; 1024];
14406 rng.fill_bytes(&mut buf);
14407 let mut unstructured = Unstructured::new(&buf);
14408 Self::arbitrary(&mut unstructured).unwrap_or_default()
14409 }
14410}
14411impl Default for GPS_INPUT_DATA {
14412 fn default() -> Self {
14413 Self::DEFAULT.clone()
14414 }
14415}
14416impl MessageData for GPS_INPUT_DATA {
14417 type Message = MavMessage;
14418 const ID: u32 = 232u32;
14419 const NAME: &'static str = "GPS_INPUT";
14420 const EXTRA_CRC: u8 = 151u8;
14421 const ENCODED_LEN: usize = 65usize;
14422 fn deser(
14423 _version: MavlinkVersion,
14424 __input: &[u8],
14425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14426 let avail_len = __input.len();
14427 let mut payload_buf = [0; Self::ENCODED_LEN];
14428 let mut buf = if avail_len < Self::ENCODED_LEN {
14429 payload_buf[0..avail_len].copy_from_slice(__input);
14430 Bytes::new(&payload_buf)
14431 } else {
14432 Bytes::new(__input)
14433 };
14434 let mut __struct = Self::default();
14435 __struct.time_usec = buf.get_u64_le()?;
14436 __struct.time_week_ms = buf.get_u32_le()?;
14437 __struct.lat = buf.get_i32_le()?;
14438 __struct.lon = buf.get_i32_le()?;
14439 __struct.alt = buf.get_f32_le()?;
14440 __struct.hdop = buf.get_f32_le()?;
14441 __struct.vdop = buf.get_f32_le()?;
14442 __struct.vn = buf.get_f32_le()?;
14443 __struct.ve = buf.get_f32_le()?;
14444 __struct.vd = buf.get_f32_le()?;
14445 __struct.speed_accuracy = buf.get_f32_le()?;
14446 __struct.horiz_accuracy = buf.get_f32_le()?;
14447 __struct.vert_accuracy = buf.get_f32_le()?;
14448 let tmp = buf.get_u16_le()?;
14449 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14450 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
14451 )
14452 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14453 flag_type: "GpsInputIgnoreFlags",
14454 value: tmp as u64,
14455 })?;
14456 __struct.time_week = buf.get_u16_le()?;
14457 __struct.gps_id = buf.get_u8()?;
14458 __struct.fix_type = buf.get_u8()?;
14459 __struct.satellites_visible = buf.get_u8()?;
14460 __struct.yaw = buf.get_u16_le()?;
14461 Ok(__struct)
14462 }
14463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14464 let mut __tmp = BytesMut::new(bytes);
14465 #[allow(clippy::absurd_extreme_comparisons)]
14466 #[allow(unused_comparisons)]
14467 if __tmp.remaining() < Self::ENCODED_LEN {
14468 panic!(
14469 "buffer is too small (need {} bytes, but got {})",
14470 Self::ENCODED_LEN,
14471 __tmp.remaining(),
14472 )
14473 }
14474 __tmp.put_u64_le(self.time_usec);
14475 __tmp.put_u32_le(self.time_week_ms);
14476 __tmp.put_i32_le(self.lat);
14477 __tmp.put_i32_le(self.lon);
14478 __tmp.put_f32_le(self.alt);
14479 __tmp.put_f32_le(self.hdop);
14480 __tmp.put_f32_le(self.vdop);
14481 __tmp.put_f32_le(self.vn);
14482 __tmp.put_f32_le(self.ve);
14483 __tmp.put_f32_le(self.vd);
14484 __tmp.put_f32_le(self.speed_accuracy);
14485 __tmp.put_f32_le(self.horiz_accuracy);
14486 __tmp.put_f32_le(self.vert_accuracy);
14487 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
14488 __tmp.put_u16_le(self.time_week);
14489 __tmp.put_u8(self.gps_id);
14490 __tmp.put_u8(self.fix_type);
14491 __tmp.put_u8(self.satellites_visible);
14492 if matches!(version, MavlinkVersion::V2) {
14493 __tmp.put_u16_le(self.yaw);
14494 let len = __tmp.len();
14495 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14496 } else {
14497 __tmp.len()
14498 }
14499 }
14500}
14501#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14502#[doc = ""]
14503#[doc = "ID: 24"]
14504#[derive(Debug, Clone, PartialEq)]
14505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14507#[cfg_attr(feature = "ts", derive(TS))]
14508#[cfg_attr(feature = "ts", ts(export))]
14509pub struct GPS_RAW_INT_DATA {
14510 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14511 pub time_usec: u64,
14512 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14513 pub lat: i32,
14514 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14515 pub lon: i32,
14516 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14517 pub alt: i32,
14518 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14519 pub eph: u16,
14520 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14521 pub epv: u16,
14522 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14523 pub vel: u16,
14524 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14525 pub cog: u16,
14526 #[doc = "GPS fix type."]
14527 pub fix_type: GpsFixType,
14528 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14529 pub satellites_visible: u8,
14530 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14531 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14532 pub alt_ellipsoid: i32,
14533 #[doc = "Position uncertainty."]
14534 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14535 pub h_acc: u32,
14536 #[doc = "Altitude uncertainty."]
14537 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14538 pub v_acc: u32,
14539 #[doc = "Speed uncertainty."]
14540 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14541 pub vel_acc: u32,
14542 #[doc = "Heading / track uncertainty"]
14543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14544 pub hdg_acc: u32,
14545 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14547 pub yaw: u16,
14548}
14549impl GPS_RAW_INT_DATA {
14550 pub const ENCODED_LEN: usize = 52usize;
14551 pub const DEFAULT: Self = Self {
14552 time_usec: 0_u64,
14553 lat: 0_i32,
14554 lon: 0_i32,
14555 alt: 0_i32,
14556 eph: 0_u16,
14557 epv: 0_u16,
14558 vel: 0_u16,
14559 cog: 0_u16,
14560 fix_type: GpsFixType::DEFAULT,
14561 satellites_visible: 0_u8,
14562 alt_ellipsoid: 0_i32,
14563 h_acc: 0_u32,
14564 v_acc: 0_u32,
14565 vel_acc: 0_u32,
14566 hdg_acc: 0_u32,
14567 yaw: 0_u16,
14568 };
14569 #[cfg(feature = "arbitrary")]
14570 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14571 use arbitrary::{Arbitrary, Unstructured};
14572 let mut buf = [0u8; 1024];
14573 rng.fill_bytes(&mut buf);
14574 let mut unstructured = Unstructured::new(&buf);
14575 Self::arbitrary(&mut unstructured).unwrap_or_default()
14576 }
14577}
14578impl Default for GPS_RAW_INT_DATA {
14579 fn default() -> Self {
14580 Self::DEFAULT.clone()
14581 }
14582}
14583impl MessageData for GPS_RAW_INT_DATA {
14584 type Message = MavMessage;
14585 const ID: u32 = 24u32;
14586 const NAME: &'static str = "GPS_RAW_INT";
14587 const EXTRA_CRC: u8 = 24u8;
14588 const ENCODED_LEN: usize = 52usize;
14589 fn deser(
14590 _version: MavlinkVersion,
14591 __input: &[u8],
14592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14593 let avail_len = __input.len();
14594 let mut payload_buf = [0; Self::ENCODED_LEN];
14595 let mut buf = if avail_len < Self::ENCODED_LEN {
14596 payload_buf[0..avail_len].copy_from_slice(__input);
14597 Bytes::new(&payload_buf)
14598 } else {
14599 Bytes::new(__input)
14600 };
14601 let mut __struct = Self::default();
14602 __struct.time_usec = buf.get_u64_le()?;
14603 __struct.lat = buf.get_i32_le()?;
14604 __struct.lon = buf.get_i32_le()?;
14605 __struct.alt = buf.get_i32_le()?;
14606 __struct.eph = buf.get_u16_le()?;
14607 __struct.epv = buf.get_u16_le()?;
14608 __struct.vel = buf.get_u16_le()?;
14609 __struct.cog = buf.get_u16_le()?;
14610 let tmp = buf.get_u8()?;
14611 __struct.fix_type =
14612 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14613 enum_type: "GpsFixType",
14614 value: tmp as u64,
14615 })?;
14616 __struct.satellites_visible = buf.get_u8()?;
14617 __struct.alt_ellipsoid = buf.get_i32_le()?;
14618 __struct.h_acc = buf.get_u32_le()?;
14619 __struct.v_acc = buf.get_u32_le()?;
14620 __struct.vel_acc = buf.get_u32_le()?;
14621 __struct.hdg_acc = buf.get_u32_le()?;
14622 __struct.yaw = buf.get_u16_le()?;
14623 Ok(__struct)
14624 }
14625 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14626 let mut __tmp = BytesMut::new(bytes);
14627 #[allow(clippy::absurd_extreme_comparisons)]
14628 #[allow(unused_comparisons)]
14629 if __tmp.remaining() < Self::ENCODED_LEN {
14630 panic!(
14631 "buffer is too small (need {} bytes, but got {})",
14632 Self::ENCODED_LEN,
14633 __tmp.remaining(),
14634 )
14635 }
14636 __tmp.put_u64_le(self.time_usec);
14637 __tmp.put_i32_le(self.lat);
14638 __tmp.put_i32_le(self.lon);
14639 __tmp.put_i32_le(self.alt);
14640 __tmp.put_u16_le(self.eph);
14641 __tmp.put_u16_le(self.epv);
14642 __tmp.put_u16_le(self.vel);
14643 __tmp.put_u16_le(self.cog);
14644 __tmp.put_u8(self.fix_type as u8);
14645 __tmp.put_u8(self.satellites_visible);
14646 if matches!(version, MavlinkVersion::V2) {
14647 __tmp.put_i32_le(self.alt_ellipsoid);
14648 __tmp.put_u32_le(self.h_acc);
14649 __tmp.put_u32_le(self.v_acc);
14650 __tmp.put_u32_le(self.vel_acc);
14651 __tmp.put_u32_le(self.hdg_acc);
14652 __tmp.put_u16_le(self.yaw);
14653 let len = __tmp.len();
14654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14655 } else {
14656 __tmp.len()
14657 }
14658 }
14659}
14660#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14661#[doc = ""]
14662#[doc = "ID: 233"]
14663#[derive(Debug, Clone, PartialEq)]
14664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14666#[cfg_attr(feature = "ts", derive(TS))]
14667#[cfg_attr(feature = "ts", ts(export))]
14668pub struct GPS_RTCM_DATA_DATA {
14669 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14670 pub flags: u8,
14671 #[doc = "data length"]
14672 pub len: u8,
14673 #[doc = "RTCM message (may be fragmented)"]
14674 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14675 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14676 pub data: [u8; 180],
14677}
14678impl GPS_RTCM_DATA_DATA {
14679 pub const ENCODED_LEN: usize = 182usize;
14680 pub const DEFAULT: Self = Self {
14681 flags: 0_u8,
14682 len: 0_u8,
14683 data: [0_u8; 180usize],
14684 };
14685 #[cfg(feature = "arbitrary")]
14686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14687 use arbitrary::{Arbitrary, Unstructured};
14688 let mut buf = [0u8; 1024];
14689 rng.fill_bytes(&mut buf);
14690 let mut unstructured = Unstructured::new(&buf);
14691 Self::arbitrary(&mut unstructured).unwrap_or_default()
14692 }
14693}
14694impl Default for GPS_RTCM_DATA_DATA {
14695 fn default() -> Self {
14696 Self::DEFAULT.clone()
14697 }
14698}
14699impl MessageData for GPS_RTCM_DATA_DATA {
14700 type Message = MavMessage;
14701 const ID: u32 = 233u32;
14702 const NAME: &'static str = "GPS_RTCM_DATA";
14703 const EXTRA_CRC: u8 = 35u8;
14704 const ENCODED_LEN: usize = 182usize;
14705 fn deser(
14706 _version: MavlinkVersion,
14707 __input: &[u8],
14708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14709 let avail_len = __input.len();
14710 let mut payload_buf = [0; Self::ENCODED_LEN];
14711 let mut buf = if avail_len < Self::ENCODED_LEN {
14712 payload_buf[0..avail_len].copy_from_slice(__input);
14713 Bytes::new(&payload_buf)
14714 } else {
14715 Bytes::new(__input)
14716 };
14717 let mut __struct = Self::default();
14718 __struct.flags = buf.get_u8()?;
14719 __struct.len = buf.get_u8()?;
14720 for v in &mut __struct.data {
14721 let val = buf.get_u8()?;
14722 *v = val;
14723 }
14724 Ok(__struct)
14725 }
14726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14727 let mut __tmp = BytesMut::new(bytes);
14728 #[allow(clippy::absurd_extreme_comparisons)]
14729 #[allow(unused_comparisons)]
14730 if __tmp.remaining() < Self::ENCODED_LEN {
14731 panic!(
14732 "buffer is too small (need {} bytes, but got {})",
14733 Self::ENCODED_LEN,
14734 __tmp.remaining(),
14735 )
14736 }
14737 __tmp.put_u8(self.flags);
14738 __tmp.put_u8(self.len);
14739 for val in &self.data {
14740 __tmp.put_u8(*val);
14741 }
14742 if matches!(version, MavlinkVersion::V2) {
14743 let len = __tmp.len();
14744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14745 } else {
14746 __tmp.len()
14747 }
14748 }
14749}
14750#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14751#[doc = ""]
14752#[doc = "ID: 127"]
14753#[derive(Debug, Clone, PartialEq)]
14754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14756#[cfg_attr(feature = "ts", derive(TS))]
14757#[cfg_attr(feature = "ts", ts(export))]
14758pub struct GPS_RTK_DATA {
14759 #[doc = "Time since boot of last baseline message received."]
14760 pub time_last_baseline_ms: u32,
14761 #[doc = "GPS Time of Week of last baseline"]
14762 pub tow: u32,
14763 #[doc = "Current baseline in ECEF x or NED north component."]
14764 pub baseline_a_mm: i32,
14765 #[doc = "Current baseline in ECEF y or NED east component."]
14766 pub baseline_b_mm: i32,
14767 #[doc = "Current baseline in ECEF z or NED down component."]
14768 pub baseline_c_mm: i32,
14769 #[doc = "Current estimate of baseline accuracy."]
14770 pub accuracy: u32,
14771 #[doc = "Current number of integer ambiguity hypotheses."]
14772 pub iar_num_hypotheses: i32,
14773 #[doc = "GPS Week Number of last baseline"]
14774 pub wn: u16,
14775 #[doc = "Identification of connected RTK receiver."]
14776 pub rtk_receiver_id: u8,
14777 #[doc = "GPS-specific health report for RTK data."]
14778 pub rtk_health: u8,
14779 #[doc = "Rate of baseline messages being received by GPS"]
14780 pub rtk_rate: u8,
14781 #[doc = "Current number of sats used for RTK calculation."]
14782 pub nsats: u8,
14783 #[doc = "Coordinate system of baseline"]
14784 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14785}
14786impl GPS_RTK_DATA {
14787 pub const ENCODED_LEN: usize = 35usize;
14788 pub const DEFAULT: Self = Self {
14789 time_last_baseline_ms: 0_u32,
14790 tow: 0_u32,
14791 baseline_a_mm: 0_i32,
14792 baseline_b_mm: 0_i32,
14793 baseline_c_mm: 0_i32,
14794 accuracy: 0_u32,
14795 iar_num_hypotheses: 0_i32,
14796 wn: 0_u16,
14797 rtk_receiver_id: 0_u8,
14798 rtk_health: 0_u8,
14799 rtk_rate: 0_u8,
14800 nsats: 0_u8,
14801 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14802 };
14803 #[cfg(feature = "arbitrary")]
14804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14805 use arbitrary::{Arbitrary, Unstructured};
14806 let mut buf = [0u8; 1024];
14807 rng.fill_bytes(&mut buf);
14808 let mut unstructured = Unstructured::new(&buf);
14809 Self::arbitrary(&mut unstructured).unwrap_or_default()
14810 }
14811}
14812impl Default for GPS_RTK_DATA {
14813 fn default() -> Self {
14814 Self::DEFAULT.clone()
14815 }
14816}
14817impl MessageData for GPS_RTK_DATA {
14818 type Message = MavMessage;
14819 const ID: u32 = 127u32;
14820 const NAME: &'static str = "GPS_RTK";
14821 const EXTRA_CRC: u8 = 25u8;
14822 const ENCODED_LEN: usize = 35usize;
14823 fn deser(
14824 _version: MavlinkVersion,
14825 __input: &[u8],
14826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14827 let avail_len = __input.len();
14828 let mut payload_buf = [0; Self::ENCODED_LEN];
14829 let mut buf = if avail_len < Self::ENCODED_LEN {
14830 payload_buf[0..avail_len].copy_from_slice(__input);
14831 Bytes::new(&payload_buf)
14832 } else {
14833 Bytes::new(__input)
14834 };
14835 let mut __struct = Self::default();
14836 __struct.time_last_baseline_ms = buf.get_u32_le()?;
14837 __struct.tow = buf.get_u32_le()?;
14838 __struct.baseline_a_mm = buf.get_i32_le()?;
14839 __struct.baseline_b_mm = buf.get_i32_le()?;
14840 __struct.baseline_c_mm = buf.get_i32_le()?;
14841 __struct.accuracy = buf.get_u32_le()?;
14842 __struct.iar_num_hypotheses = buf.get_i32_le()?;
14843 __struct.wn = buf.get_u16_le()?;
14844 __struct.rtk_receiver_id = buf.get_u8()?;
14845 __struct.rtk_health = buf.get_u8()?;
14846 __struct.rtk_rate = buf.get_u8()?;
14847 __struct.nsats = buf.get_u8()?;
14848 let tmp = buf.get_u8()?;
14849 __struct.baseline_coords_type =
14850 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14851 enum_type: "RtkBaselineCoordinateSystem",
14852 value: tmp as u64,
14853 })?;
14854 Ok(__struct)
14855 }
14856 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14857 let mut __tmp = BytesMut::new(bytes);
14858 #[allow(clippy::absurd_extreme_comparisons)]
14859 #[allow(unused_comparisons)]
14860 if __tmp.remaining() < Self::ENCODED_LEN {
14861 panic!(
14862 "buffer is too small (need {} bytes, but got {})",
14863 Self::ENCODED_LEN,
14864 __tmp.remaining(),
14865 )
14866 }
14867 __tmp.put_u32_le(self.time_last_baseline_ms);
14868 __tmp.put_u32_le(self.tow);
14869 __tmp.put_i32_le(self.baseline_a_mm);
14870 __tmp.put_i32_le(self.baseline_b_mm);
14871 __tmp.put_i32_le(self.baseline_c_mm);
14872 __tmp.put_u32_le(self.accuracy);
14873 __tmp.put_i32_le(self.iar_num_hypotheses);
14874 __tmp.put_u16_le(self.wn);
14875 __tmp.put_u8(self.rtk_receiver_id);
14876 __tmp.put_u8(self.rtk_health);
14877 __tmp.put_u8(self.rtk_rate);
14878 __tmp.put_u8(self.nsats);
14879 __tmp.put_u8(self.baseline_coords_type as u8);
14880 if matches!(version, MavlinkVersion::V2) {
14881 let len = __tmp.len();
14882 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14883 } else {
14884 __tmp.len()
14885 }
14886 }
14887}
14888#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14889#[doc = ""]
14890#[doc = "ID: 25"]
14891#[derive(Debug, Clone, PartialEq)]
14892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14894#[cfg_attr(feature = "ts", derive(TS))]
14895#[cfg_attr(feature = "ts", ts(export))]
14896pub struct GPS_STATUS_DATA {
14897 #[doc = "Number of satellites visible"]
14898 pub satellites_visible: u8,
14899 #[doc = "Global satellite ID"]
14900 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14901 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14902 pub satellite_prn: [u8; 20],
14903 #[doc = "0: Satellite not used, 1: used for localization"]
14904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14905 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14906 pub satellite_used: [u8; 20],
14907 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14908 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14909 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14910 pub satellite_elevation: [u8; 20],
14911 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14912 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14913 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14914 pub satellite_azimuth: [u8; 20],
14915 #[doc = "Signal to noise ratio of satellite"]
14916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14917 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14918 pub satellite_snr: [u8; 20],
14919}
14920impl GPS_STATUS_DATA {
14921 pub const ENCODED_LEN: usize = 101usize;
14922 pub const DEFAULT: Self = Self {
14923 satellites_visible: 0_u8,
14924 satellite_prn: [0_u8; 20usize],
14925 satellite_used: [0_u8; 20usize],
14926 satellite_elevation: [0_u8; 20usize],
14927 satellite_azimuth: [0_u8; 20usize],
14928 satellite_snr: [0_u8; 20usize],
14929 };
14930 #[cfg(feature = "arbitrary")]
14931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14932 use arbitrary::{Arbitrary, Unstructured};
14933 let mut buf = [0u8; 1024];
14934 rng.fill_bytes(&mut buf);
14935 let mut unstructured = Unstructured::new(&buf);
14936 Self::arbitrary(&mut unstructured).unwrap_or_default()
14937 }
14938}
14939impl Default for GPS_STATUS_DATA {
14940 fn default() -> Self {
14941 Self::DEFAULT.clone()
14942 }
14943}
14944impl MessageData for GPS_STATUS_DATA {
14945 type Message = MavMessage;
14946 const ID: u32 = 25u32;
14947 const NAME: &'static str = "GPS_STATUS";
14948 const EXTRA_CRC: u8 = 23u8;
14949 const ENCODED_LEN: usize = 101usize;
14950 fn deser(
14951 _version: MavlinkVersion,
14952 __input: &[u8],
14953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14954 let avail_len = __input.len();
14955 let mut payload_buf = [0; Self::ENCODED_LEN];
14956 let mut buf = if avail_len < Self::ENCODED_LEN {
14957 payload_buf[0..avail_len].copy_from_slice(__input);
14958 Bytes::new(&payload_buf)
14959 } else {
14960 Bytes::new(__input)
14961 };
14962 let mut __struct = Self::default();
14963 __struct.satellites_visible = buf.get_u8()?;
14964 for v in &mut __struct.satellite_prn {
14965 let val = buf.get_u8()?;
14966 *v = val;
14967 }
14968 for v in &mut __struct.satellite_used {
14969 let val = buf.get_u8()?;
14970 *v = val;
14971 }
14972 for v in &mut __struct.satellite_elevation {
14973 let val = buf.get_u8()?;
14974 *v = val;
14975 }
14976 for v in &mut __struct.satellite_azimuth {
14977 let val = buf.get_u8()?;
14978 *v = val;
14979 }
14980 for v in &mut __struct.satellite_snr {
14981 let val = buf.get_u8()?;
14982 *v = val;
14983 }
14984 Ok(__struct)
14985 }
14986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14987 let mut __tmp = BytesMut::new(bytes);
14988 #[allow(clippy::absurd_extreme_comparisons)]
14989 #[allow(unused_comparisons)]
14990 if __tmp.remaining() < Self::ENCODED_LEN {
14991 panic!(
14992 "buffer is too small (need {} bytes, but got {})",
14993 Self::ENCODED_LEN,
14994 __tmp.remaining(),
14995 )
14996 }
14997 __tmp.put_u8(self.satellites_visible);
14998 for val in &self.satellite_prn {
14999 __tmp.put_u8(*val);
15000 }
15001 for val in &self.satellite_used {
15002 __tmp.put_u8(*val);
15003 }
15004 for val in &self.satellite_elevation {
15005 __tmp.put_u8(*val);
15006 }
15007 for val in &self.satellite_azimuth {
15008 __tmp.put_u8(*val);
15009 }
15010 for val in &self.satellite_snr {
15011 __tmp.put_u8(*val);
15012 }
15013 if matches!(version, MavlinkVersion::V2) {
15014 let len = __tmp.len();
15015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15016 } else {
15017 __tmp.len()
15018 }
15019 }
15020}
15021#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15022#[doc = ""]
15023#[doc = "ID: 0"]
15024#[derive(Debug, Clone, PartialEq)]
15025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15027#[cfg_attr(feature = "ts", derive(TS))]
15028#[cfg_attr(feature = "ts", ts(export))]
15029pub struct HEARTBEAT_DATA {
15030 #[doc = "A bitfield for use for autopilot-specific flags"]
15031 pub custom_mode: u32,
15032 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15033 pub mavtype: MavType,
15034 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15035 pub autopilot: MavAutopilot,
15036 #[doc = "System mode bitmap."]
15037 pub base_mode: MavModeFlag,
15038 #[doc = "System status flag."]
15039 pub system_status: MavState,
15040 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15041 pub mavlink_version: u8,
15042}
15043impl HEARTBEAT_DATA {
15044 pub const ENCODED_LEN: usize = 9usize;
15045 pub const DEFAULT: Self = Self {
15046 custom_mode: 0_u32,
15047 mavtype: MavType::DEFAULT,
15048 autopilot: MavAutopilot::DEFAULT,
15049 base_mode: MavModeFlag::DEFAULT,
15050 system_status: MavState::DEFAULT,
15051 mavlink_version: MINOR_MAVLINK_VERSION,
15052 };
15053 #[cfg(feature = "arbitrary")]
15054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15055 use arbitrary::{Arbitrary, Unstructured};
15056 let mut buf = [0u8; 1024];
15057 rng.fill_bytes(&mut buf);
15058 let mut unstructured = Unstructured::new(&buf);
15059 Self::arbitrary(&mut unstructured).unwrap_or_default()
15060 }
15061}
15062impl Default for HEARTBEAT_DATA {
15063 fn default() -> Self {
15064 Self::DEFAULT.clone()
15065 }
15066}
15067impl MessageData for HEARTBEAT_DATA {
15068 type Message = MavMessage;
15069 const ID: u32 = 0u32;
15070 const NAME: &'static str = "HEARTBEAT";
15071 const EXTRA_CRC: u8 = 50u8;
15072 const ENCODED_LEN: usize = 9usize;
15073 fn deser(
15074 _version: MavlinkVersion,
15075 __input: &[u8],
15076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15077 let avail_len = __input.len();
15078 let mut payload_buf = [0; Self::ENCODED_LEN];
15079 let mut buf = if avail_len < Self::ENCODED_LEN {
15080 payload_buf[0..avail_len].copy_from_slice(__input);
15081 Bytes::new(&payload_buf)
15082 } else {
15083 Bytes::new(__input)
15084 };
15085 let mut __struct = Self::default();
15086 __struct.custom_mode = buf.get_u32_le()?;
15087 let tmp = buf.get_u8()?;
15088 __struct.mavtype =
15089 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15090 enum_type: "MavType",
15091 value: tmp as u64,
15092 })?;
15093 let tmp = buf.get_u8()?;
15094 __struct.autopilot =
15095 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15096 enum_type: "MavAutopilot",
15097 value: tmp as u64,
15098 })?;
15099 let tmp = buf.get_u8()?;
15100 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15101 ::mavlink_core::error::ParserError::InvalidFlag {
15102 flag_type: "MavModeFlag",
15103 value: tmp as u64,
15104 },
15105 )?;
15106 let tmp = buf.get_u8()?;
15107 __struct.system_status =
15108 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15109 enum_type: "MavState",
15110 value: tmp as u64,
15111 })?;
15112 __struct.mavlink_version = buf.get_u8()?;
15113 Ok(__struct)
15114 }
15115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15116 let mut __tmp = BytesMut::new(bytes);
15117 #[allow(clippy::absurd_extreme_comparisons)]
15118 #[allow(unused_comparisons)]
15119 if __tmp.remaining() < Self::ENCODED_LEN {
15120 panic!(
15121 "buffer is too small (need {} bytes, but got {})",
15122 Self::ENCODED_LEN,
15123 __tmp.remaining(),
15124 )
15125 }
15126 __tmp.put_u32_le(self.custom_mode);
15127 __tmp.put_u8(self.mavtype as u8);
15128 __tmp.put_u8(self.autopilot as u8);
15129 __tmp.put_u8(self.base_mode.bits() as u8);
15130 __tmp.put_u8(self.system_status as u8);
15131 __tmp.put_u8(self.mavlink_version);
15132 if matches!(version, MavlinkVersion::V2) {
15133 let len = __tmp.len();
15134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15135 } else {
15136 __tmp.len()
15137 }
15138 }
15139}
15140#[doc = "The IMU readings in SI units in NED body frame."]
15141#[doc = ""]
15142#[doc = "ID: 105"]
15143#[derive(Debug, Clone, PartialEq)]
15144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15146#[cfg_attr(feature = "ts", derive(TS))]
15147#[cfg_attr(feature = "ts", ts(export))]
15148pub struct HIGHRES_IMU_DATA {
15149 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15150 pub time_usec: u64,
15151 #[doc = "X acceleration"]
15152 pub xacc: f32,
15153 #[doc = "Y acceleration"]
15154 pub yacc: f32,
15155 #[doc = "Z acceleration"]
15156 pub zacc: f32,
15157 #[doc = "Angular speed around X axis"]
15158 pub xgyro: f32,
15159 #[doc = "Angular speed around Y axis"]
15160 pub ygyro: f32,
15161 #[doc = "Angular speed around Z axis"]
15162 pub zgyro: f32,
15163 #[doc = "X Magnetic field"]
15164 pub xmag: f32,
15165 #[doc = "Y Magnetic field"]
15166 pub ymag: f32,
15167 #[doc = "Z Magnetic field"]
15168 pub zmag: f32,
15169 #[doc = "Absolute pressure"]
15170 pub abs_pressure: f32,
15171 #[doc = "Differential pressure"]
15172 pub diff_pressure: f32,
15173 #[doc = "Altitude calculated from pressure"]
15174 pub pressure_alt: f32,
15175 #[doc = "Temperature"]
15176 pub temperature: f32,
15177 #[doc = "Bitmap for fields that have updated since last message"]
15178 pub fields_updated: HighresImuUpdatedFlags,
15179 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15181 pub id: u8,
15182}
15183impl HIGHRES_IMU_DATA {
15184 pub const ENCODED_LEN: usize = 63usize;
15185 pub const DEFAULT: Self = Self {
15186 time_usec: 0_u64,
15187 xacc: 0.0_f32,
15188 yacc: 0.0_f32,
15189 zacc: 0.0_f32,
15190 xgyro: 0.0_f32,
15191 ygyro: 0.0_f32,
15192 zgyro: 0.0_f32,
15193 xmag: 0.0_f32,
15194 ymag: 0.0_f32,
15195 zmag: 0.0_f32,
15196 abs_pressure: 0.0_f32,
15197 diff_pressure: 0.0_f32,
15198 pressure_alt: 0.0_f32,
15199 temperature: 0.0_f32,
15200 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15201 id: 0_u8,
15202 };
15203 #[cfg(feature = "arbitrary")]
15204 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15205 use arbitrary::{Arbitrary, Unstructured};
15206 let mut buf = [0u8; 1024];
15207 rng.fill_bytes(&mut buf);
15208 let mut unstructured = Unstructured::new(&buf);
15209 Self::arbitrary(&mut unstructured).unwrap_or_default()
15210 }
15211}
15212impl Default for HIGHRES_IMU_DATA {
15213 fn default() -> Self {
15214 Self::DEFAULT.clone()
15215 }
15216}
15217impl MessageData for HIGHRES_IMU_DATA {
15218 type Message = MavMessage;
15219 const ID: u32 = 105u32;
15220 const NAME: &'static str = "HIGHRES_IMU";
15221 const EXTRA_CRC: u8 = 93u8;
15222 const ENCODED_LEN: usize = 63usize;
15223 fn deser(
15224 _version: MavlinkVersion,
15225 __input: &[u8],
15226 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15227 let avail_len = __input.len();
15228 let mut payload_buf = [0; Self::ENCODED_LEN];
15229 let mut buf = if avail_len < Self::ENCODED_LEN {
15230 payload_buf[0..avail_len].copy_from_slice(__input);
15231 Bytes::new(&payload_buf)
15232 } else {
15233 Bytes::new(__input)
15234 };
15235 let mut __struct = Self::default();
15236 __struct.time_usec = buf.get_u64_le()?;
15237 __struct.xacc = buf.get_f32_le()?;
15238 __struct.yacc = buf.get_f32_le()?;
15239 __struct.zacc = buf.get_f32_le()?;
15240 __struct.xgyro = buf.get_f32_le()?;
15241 __struct.ygyro = buf.get_f32_le()?;
15242 __struct.zgyro = buf.get_f32_le()?;
15243 __struct.xmag = buf.get_f32_le()?;
15244 __struct.ymag = buf.get_f32_le()?;
15245 __struct.zmag = buf.get_f32_le()?;
15246 __struct.abs_pressure = buf.get_f32_le()?;
15247 __struct.diff_pressure = buf.get_f32_le()?;
15248 __struct.pressure_alt = buf.get_f32_le()?;
15249 __struct.temperature = buf.get_f32_le()?;
15250 let tmp = buf.get_u16_le()?;
15251 __struct.fields_updated =
15252 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15253 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15254 flag_type: "HighresImuUpdatedFlags",
15255 value: tmp as u64,
15256 })?;
15257 __struct.id = buf.get_u8()?;
15258 Ok(__struct)
15259 }
15260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15261 let mut __tmp = BytesMut::new(bytes);
15262 #[allow(clippy::absurd_extreme_comparisons)]
15263 #[allow(unused_comparisons)]
15264 if __tmp.remaining() < Self::ENCODED_LEN {
15265 panic!(
15266 "buffer is too small (need {} bytes, but got {})",
15267 Self::ENCODED_LEN,
15268 __tmp.remaining(),
15269 )
15270 }
15271 __tmp.put_u64_le(self.time_usec);
15272 __tmp.put_f32_le(self.xacc);
15273 __tmp.put_f32_le(self.yacc);
15274 __tmp.put_f32_le(self.zacc);
15275 __tmp.put_f32_le(self.xgyro);
15276 __tmp.put_f32_le(self.ygyro);
15277 __tmp.put_f32_le(self.zgyro);
15278 __tmp.put_f32_le(self.xmag);
15279 __tmp.put_f32_le(self.ymag);
15280 __tmp.put_f32_le(self.zmag);
15281 __tmp.put_f32_le(self.abs_pressure);
15282 __tmp.put_f32_le(self.diff_pressure);
15283 __tmp.put_f32_le(self.pressure_alt);
15284 __tmp.put_f32_le(self.temperature);
15285 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15286 if matches!(version, MavlinkVersion::V2) {
15287 __tmp.put_u8(self.id);
15288 let len = __tmp.len();
15289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15290 } else {
15291 __tmp.len()
15292 }
15293 }
15294}
15295#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15296#[doc = "Message appropriate for high latency connections like Iridium."]
15297#[doc = ""]
15298#[doc = "ID: 234"]
15299#[derive(Debug, Clone, PartialEq)]
15300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15302#[cfg_attr(feature = "ts", derive(TS))]
15303#[cfg_attr(feature = "ts", ts(export))]
15304pub struct HIGH_LATENCY_DATA {
15305 #[doc = "A bitfield for use for autopilot-specific flags."]
15306 pub custom_mode: u32,
15307 #[doc = "Latitude"]
15308 pub latitude: i32,
15309 #[doc = "Longitude"]
15310 pub longitude: i32,
15311 #[doc = "roll"]
15312 pub roll: i16,
15313 #[doc = "pitch"]
15314 pub pitch: i16,
15315 #[doc = "heading"]
15316 pub heading: u16,
15317 #[doc = "heading setpoint"]
15318 pub heading_sp: i16,
15319 #[doc = "Altitude above mean sea level"]
15320 pub altitude_amsl: i16,
15321 #[doc = "Altitude setpoint relative to the home position"]
15322 pub altitude_sp: i16,
15323 #[doc = "distance to target"]
15324 pub wp_distance: u16,
15325 #[doc = "Bitmap of enabled system modes."]
15326 pub base_mode: MavModeFlag,
15327 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15328 pub landed_state: MavLandedState,
15329 #[doc = "throttle (percentage)"]
15330 pub throttle: i8,
15331 #[doc = "airspeed"]
15332 pub airspeed: u8,
15333 #[doc = "airspeed setpoint"]
15334 pub airspeed_sp: u8,
15335 #[doc = "groundspeed"]
15336 pub groundspeed: u8,
15337 #[doc = "climb rate"]
15338 pub climb_rate: i8,
15339 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15340 pub gps_nsat: u8,
15341 #[doc = "GPS Fix type."]
15342 pub gps_fix_type: GpsFixType,
15343 #[doc = "Remaining battery (percentage)"]
15344 pub battery_remaining: u8,
15345 #[doc = "Autopilot temperature (degrees C)"]
15346 pub temperature: i8,
15347 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15348 pub temperature_air: i8,
15349 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15350 pub failsafe: u8,
15351 #[doc = "current waypoint number"]
15352 pub wp_num: u8,
15353}
15354impl HIGH_LATENCY_DATA {
15355 pub const ENCODED_LEN: usize = 40usize;
15356 pub const DEFAULT: Self = Self {
15357 custom_mode: 0_u32,
15358 latitude: 0_i32,
15359 longitude: 0_i32,
15360 roll: 0_i16,
15361 pitch: 0_i16,
15362 heading: 0_u16,
15363 heading_sp: 0_i16,
15364 altitude_amsl: 0_i16,
15365 altitude_sp: 0_i16,
15366 wp_distance: 0_u16,
15367 base_mode: MavModeFlag::DEFAULT,
15368 landed_state: MavLandedState::DEFAULT,
15369 throttle: 0_i8,
15370 airspeed: 0_u8,
15371 airspeed_sp: 0_u8,
15372 groundspeed: 0_u8,
15373 climb_rate: 0_i8,
15374 gps_nsat: 0_u8,
15375 gps_fix_type: GpsFixType::DEFAULT,
15376 battery_remaining: 0_u8,
15377 temperature: 0_i8,
15378 temperature_air: 0_i8,
15379 failsafe: 0_u8,
15380 wp_num: 0_u8,
15381 };
15382 #[cfg(feature = "arbitrary")]
15383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15384 use arbitrary::{Arbitrary, Unstructured};
15385 let mut buf = [0u8; 1024];
15386 rng.fill_bytes(&mut buf);
15387 let mut unstructured = Unstructured::new(&buf);
15388 Self::arbitrary(&mut unstructured).unwrap_or_default()
15389 }
15390}
15391impl Default for HIGH_LATENCY_DATA {
15392 fn default() -> Self {
15393 Self::DEFAULT.clone()
15394 }
15395}
15396impl MessageData for HIGH_LATENCY_DATA {
15397 type Message = MavMessage;
15398 const ID: u32 = 234u32;
15399 const NAME: &'static str = "HIGH_LATENCY";
15400 const EXTRA_CRC: u8 = 150u8;
15401 const ENCODED_LEN: usize = 40usize;
15402 fn deser(
15403 _version: MavlinkVersion,
15404 __input: &[u8],
15405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15406 let avail_len = __input.len();
15407 let mut payload_buf = [0; Self::ENCODED_LEN];
15408 let mut buf = if avail_len < Self::ENCODED_LEN {
15409 payload_buf[0..avail_len].copy_from_slice(__input);
15410 Bytes::new(&payload_buf)
15411 } else {
15412 Bytes::new(__input)
15413 };
15414 let mut __struct = Self::default();
15415 __struct.custom_mode = buf.get_u32_le()?;
15416 __struct.latitude = buf.get_i32_le()?;
15417 __struct.longitude = buf.get_i32_le()?;
15418 __struct.roll = buf.get_i16_le()?;
15419 __struct.pitch = buf.get_i16_le()?;
15420 __struct.heading = buf.get_u16_le()?;
15421 __struct.heading_sp = buf.get_i16_le()?;
15422 __struct.altitude_amsl = buf.get_i16_le()?;
15423 __struct.altitude_sp = buf.get_i16_le()?;
15424 __struct.wp_distance = buf.get_u16_le()?;
15425 let tmp = buf.get_u8()?;
15426 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15427 ::mavlink_core::error::ParserError::InvalidFlag {
15428 flag_type: "MavModeFlag",
15429 value: tmp as u64,
15430 },
15431 )?;
15432 let tmp = buf.get_u8()?;
15433 __struct.landed_state =
15434 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15435 enum_type: "MavLandedState",
15436 value: tmp as u64,
15437 })?;
15438 __struct.throttle = buf.get_i8()?;
15439 __struct.airspeed = buf.get_u8()?;
15440 __struct.airspeed_sp = buf.get_u8()?;
15441 __struct.groundspeed = buf.get_u8()?;
15442 __struct.climb_rate = buf.get_i8()?;
15443 __struct.gps_nsat = buf.get_u8()?;
15444 let tmp = buf.get_u8()?;
15445 __struct.gps_fix_type =
15446 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15447 enum_type: "GpsFixType",
15448 value: tmp as u64,
15449 })?;
15450 __struct.battery_remaining = buf.get_u8()?;
15451 __struct.temperature = buf.get_i8()?;
15452 __struct.temperature_air = buf.get_i8()?;
15453 __struct.failsafe = buf.get_u8()?;
15454 __struct.wp_num = buf.get_u8()?;
15455 Ok(__struct)
15456 }
15457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15458 let mut __tmp = BytesMut::new(bytes);
15459 #[allow(clippy::absurd_extreme_comparisons)]
15460 #[allow(unused_comparisons)]
15461 if __tmp.remaining() < Self::ENCODED_LEN {
15462 panic!(
15463 "buffer is too small (need {} bytes, but got {})",
15464 Self::ENCODED_LEN,
15465 __tmp.remaining(),
15466 )
15467 }
15468 __tmp.put_u32_le(self.custom_mode);
15469 __tmp.put_i32_le(self.latitude);
15470 __tmp.put_i32_le(self.longitude);
15471 __tmp.put_i16_le(self.roll);
15472 __tmp.put_i16_le(self.pitch);
15473 __tmp.put_u16_le(self.heading);
15474 __tmp.put_i16_le(self.heading_sp);
15475 __tmp.put_i16_le(self.altitude_amsl);
15476 __tmp.put_i16_le(self.altitude_sp);
15477 __tmp.put_u16_le(self.wp_distance);
15478 __tmp.put_u8(self.base_mode.bits() as u8);
15479 __tmp.put_u8(self.landed_state as u8);
15480 __tmp.put_i8(self.throttle);
15481 __tmp.put_u8(self.airspeed);
15482 __tmp.put_u8(self.airspeed_sp);
15483 __tmp.put_u8(self.groundspeed);
15484 __tmp.put_i8(self.climb_rate);
15485 __tmp.put_u8(self.gps_nsat);
15486 __tmp.put_u8(self.gps_fix_type as u8);
15487 __tmp.put_u8(self.battery_remaining);
15488 __tmp.put_i8(self.temperature);
15489 __tmp.put_i8(self.temperature_air);
15490 __tmp.put_u8(self.failsafe);
15491 __tmp.put_u8(self.wp_num);
15492 if matches!(version, MavlinkVersion::V2) {
15493 let len = __tmp.len();
15494 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15495 } else {
15496 __tmp.len()
15497 }
15498 }
15499}
15500#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15501#[doc = ""]
15502#[doc = "ID: 235"]
15503#[derive(Debug, Clone, PartialEq)]
15504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15506#[cfg_attr(feature = "ts", derive(TS))]
15507#[cfg_attr(feature = "ts", ts(export))]
15508pub struct HIGH_LATENCY2_DATA {
15509 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15510 pub timestamp: u32,
15511 #[doc = "Latitude"]
15512 pub latitude: i32,
15513 #[doc = "Longitude"]
15514 pub longitude: i32,
15515 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15516 pub custom_mode: u16,
15517 #[doc = "Altitude above mean sea level"]
15518 pub altitude: i16,
15519 #[doc = "Altitude setpoint"]
15520 pub target_altitude: i16,
15521 #[doc = "Distance to target waypoint or position"]
15522 pub target_distance: u16,
15523 #[doc = "Current waypoint number"]
15524 pub wp_num: u16,
15525 #[doc = "Bitmap of failure flags."]
15526 pub failure_flags: HlFailureFlag,
15527 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15528 pub mavtype: MavType,
15529 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15530 pub autopilot: MavAutopilot,
15531 #[doc = "Heading"]
15532 pub heading: u8,
15533 #[doc = "Heading setpoint"]
15534 pub target_heading: u8,
15535 #[doc = "Throttle"]
15536 pub throttle: u8,
15537 #[doc = "Airspeed"]
15538 pub airspeed: u8,
15539 #[doc = "Airspeed setpoint"]
15540 pub airspeed_sp: u8,
15541 #[doc = "Groundspeed"]
15542 pub groundspeed: u8,
15543 #[doc = "Windspeed"]
15544 pub windspeed: u8,
15545 #[doc = "Wind heading"]
15546 pub wind_heading: u8,
15547 #[doc = "Maximum error horizontal position since last message"]
15548 pub eph: u8,
15549 #[doc = "Maximum error vertical position since last message"]
15550 pub epv: u8,
15551 #[doc = "Air temperature"]
15552 pub temperature_air: i8,
15553 #[doc = "Maximum climb rate magnitude since last message"]
15554 pub climb_rate: i8,
15555 #[doc = "Battery level (-1 if field not provided)."]
15556 pub battery: i8,
15557 #[doc = "Field for custom payload."]
15558 pub custom0: i8,
15559 #[doc = "Field for custom payload."]
15560 pub custom1: i8,
15561 #[doc = "Field for custom payload."]
15562 pub custom2: i8,
15563}
15564impl HIGH_LATENCY2_DATA {
15565 pub const ENCODED_LEN: usize = 42usize;
15566 pub const DEFAULT: Self = Self {
15567 timestamp: 0_u32,
15568 latitude: 0_i32,
15569 longitude: 0_i32,
15570 custom_mode: 0_u16,
15571 altitude: 0_i16,
15572 target_altitude: 0_i16,
15573 target_distance: 0_u16,
15574 wp_num: 0_u16,
15575 failure_flags: HlFailureFlag::DEFAULT,
15576 mavtype: MavType::DEFAULT,
15577 autopilot: MavAutopilot::DEFAULT,
15578 heading: 0_u8,
15579 target_heading: 0_u8,
15580 throttle: 0_u8,
15581 airspeed: 0_u8,
15582 airspeed_sp: 0_u8,
15583 groundspeed: 0_u8,
15584 windspeed: 0_u8,
15585 wind_heading: 0_u8,
15586 eph: 0_u8,
15587 epv: 0_u8,
15588 temperature_air: 0_i8,
15589 climb_rate: 0_i8,
15590 battery: 0_i8,
15591 custom0: 0_i8,
15592 custom1: 0_i8,
15593 custom2: 0_i8,
15594 };
15595 #[cfg(feature = "arbitrary")]
15596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15597 use arbitrary::{Arbitrary, Unstructured};
15598 let mut buf = [0u8; 1024];
15599 rng.fill_bytes(&mut buf);
15600 let mut unstructured = Unstructured::new(&buf);
15601 Self::arbitrary(&mut unstructured).unwrap_or_default()
15602 }
15603}
15604impl Default for HIGH_LATENCY2_DATA {
15605 fn default() -> Self {
15606 Self::DEFAULT.clone()
15607 }
15608}
15609impl MessageData for HIGH_LATENCY2_DATA {
15610 type Message = MavMessage;
15611 const ID: u32 = 235u32;
15612 const NAME: &'static str = "HIGH_LATENCY2";
15613 const EXTRA_CRC: u8 = 179u8;
15614 const ENCODED_LEN: usize = 42usize;
15615 fn deser(
15616 _version: MavlinkVersion,
15617 __input: &[u8],
15618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15619 let avail_len = __input.len();
15620 let mut payload_buf = [0; Self::ENCODED_LEN];
15621 let mut buf = if avail_len < Self::ENCODED_LEN {
15622 payload_buf[0..avail_len].copy_from_slice(__input);
15623 Bytes::new(&payload_buf)
15624 } else {
15625 Bytes::new(__input)
15626 };
15627 let mut __struct = Self::default();
15628 __struct.timestamp = buf.get_u32_le()?;
15629 __struct.latitude = buf.get_i32_le()?;
15630 __struct.longitude = buf.get_i32_le()?;
15631 __struct.custom_mode = buf.get_u16_le()?;
15632 __struct.altitude = buf.get_i16_le()?;
15633 __struct.target_altitude = buf.get_i16_le()?;
15634 __struct.target_distance = buf.get_u16_le()?;
15635 __struct.wp_num = buf.get_u16_le()?;
15636 let tmp = buf.get_u16_le()?;
15637 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
15638 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15639 flag_type: "HlFailureFlag",
15640 value: tmp as u64,
15641 })?;
15642 let tmp = buf.get_u8()?;
15643 __struct.mavtype =
15644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15645 enum_type: "MavType",
15646 value: tmp as u64,
15647 })?;
15648 let tmp = buf.get_u8()?;
15649 __struct.autopilot =
15650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15651 enum_type: "MavAutopilot",
15652 value: tmp as u64,
15653 })?;
15654 __struct.heading = buf.get_u8()?;
15655 __struct.target_heading = buf.get_u8()?;
15656 __struct.throttle = buf.get_u8()?;
15657 __struct.airspeed = buf.get_u8()?;
15658 __struct.airspeed_sp = buf.get_u8()?;
15659 __struct.groundspeed = buf.get_u8()?;
15660 __struct.windspeed = buf.get_u8()?;
15661 __struct.wind_heading = buf.get_u8()?;
15662 __struct.eph = buf.get_u8()?;
15663 __struct.epv = buf.get_u8()?;
15664 __struct.temperature_air = buf.get_i8()?;
15665 __struct.climb_rate = buf.get_i8()?;
15666 __struct.battery = buf.get_i8()?;
15667 __struct.custom0 = buf.get_i8()?;
15668 __struct.custom1 = buf.get_i8()?;
15669 __struct.custom2 = buf.get_i8()?;
15670 Ok(__struct)
15671 }
15672 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15673 let mut __tmp = BytesMut::new(bytes);
15674 #[allow(clippy::absurd_extreme_comparisons)]
15675 #[allow(unused_comparisons)]
15676 if __tmp.remaining() < Self::ENCODED_LEN {
15677 panic!(
15678 "buffer is too small (need {} bytes, but got {})",
15679 Self::ENCODED_LEN,
15680 __tmp.remaining(),
15681 )
15682 }
15683 __tmp.put_u32_le(self.timestamp);
15684 __tmp.put_i32_le(self.latitude);
15685 __tmp.put_i32_le(self.longitude);
15686 __tmp.put_u16_le(self.custom_mode);
15687 __tmp.put_i16_le(self.altitude);
15688 __tmp.put_i16_le(self.target_altitude);
15689 __tmp.put_u16_le(self.target_distance);
15690 __tmp.put_u16_le(self.wp_num);
15691 __tmp.put_u16_le(self.failure_flags.bits() as u16);
15692 __tmp.put_u8(self.mavtype as u8);
15693 __tmp.put_u8(self.autopilot as u8);
15694 __tmp.put_u8(self.heading);
15695 __tmp.put_u8(self.target_heading);
15696 __tmp.put_u8(self.throttle);
15697 __tmp.put_u8(self.airspeed);
15698 __tmp.put_u8(self.airspeed_sp);
15699 __tmp.put_u8(self.groundspeed);
15700 __tmp.put_u8(self.windspeed);
15701 __tmp.put_u8(self.wind_heading);
15702 __tmp.put_u8(self.eph);
15703 __tmp.put_u8(self.epv);
15704 __tmp.put_i8(self.temperature_air);
15705 __tmp.put_i8(self.climb_rate);
15706 __tmp.put_i8(self.battery);
15707 __tmp.put_i8(self.custom0);
15708 __tmp.put_i8(self.custom1);
15709 __tmp.put_i8(self.custom2);
15710 if matches!(version, MavlinkVersion::V2) {
15711 let len = __tmp.len();
15712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15713 } else {
15714 __tmp.len()
15715 }
15716 }
15717}
15718#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15719#[doc = ""]
15720#[doc = "ID: 93"]
15721#[derive(Debug, Clone, PartialEq)]
15722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15724#[cfg_attr(feature = "ts", derive(TS))]
15725#[cfg_attr(feature = "ts", ts(export))]
15726pub struct HIL_ACTUATOR_CONTROLS_DATA {
15727 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15728 pub time_usec: u64,
15729 #[doc = "Flags bitmask."]
15730 pub flags: HilActuatorControlsFlags,
15731 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15732 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15733 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15734 pub controls: [f32; 16],
15735 #[doc = "System mode. Includes arming state."]
15736 pub mode: MavModeFlag,
15737}
15738impl HIL_ACTUATOR_CONTROLS_DATA {
15739 pub const ENCODED_LEN: usize = 81usize;
15740 pub const DEFAULT: Self = Self {
15741 time_usec: 0_u64,
15742 flags: HilActuatorControlsFlags::DEFAULT,
15743 controls: [0.0_f32; 16usize],
15744 mode: MavModeFlag::DEFAULT,
15745 };
15746 #[cfg(feature = "arbitrary")]
15747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15748 use arbitrary::{Arbitrary, Unstructured};
15749 let mut buf = [0u8; 1024];
15750 rng.fill_bytes(&mut buf);
15751 let mut unstructured = Unstructured::new(&buf);
15752 Self::arbitrary(&mut unstructured).unwrap_or_default()
15753 }
15754}
15755impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15756 fn default() -> Self {
15757 Self::DEFAULT.clone()
15758 }
15759}
15760impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15761 type Message = MavMessage;
15762 const ID: u32 = 93u32;
15763 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15764 const EXTRA_CRC: u8 = 47u8;
15765 const ENCODED_LEN: usize = 81usize;
15766 fn deser(
15767 _version: MavlinkVersion,
15768 __input: &[u8],
15769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15770 let avail_len = __input.len();
15771 let mut payload_buf = [0; Self::ENCODED_LEN];
15772 let mut buf = if avail_len < Self::ENCODED_LEN {
15773 payload_buf[0..avail_len].copy_from_slice(__input);
15774 Bytes::new(&payload_buf)
15775 } else {
15776 Bytes::new(__input)
15777 };
15778 let mut __struct = Self::default();
15779 __struct.time_usec = buf.get_u64_le()?;
15780 let tmp = buf.get_u64_le()?;
15781 __struct.flags =
15782 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
15783 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15784 flag_type: "HilActuatorControlsFlags",
15785 value: tmp as u64,
15786 })?;
15787 for v in &mut __struct.controls {
15788 let val = buf.get_f32_le()?;
15789 *v = val;
15790 }
15791 let tmp = buf.get_u8()?;
15792 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15793 ::mavlink_core::error::ParserError::InvalidFlag {
15794 flag_type: "MavModeFlag",
15795 value: tmp as u64,
15796 },
15797 )?;
15798 Ok(__struct)
15799 }
15800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15801 let mut __tmp = BytesMut::new(bytes);
15802 #[allow(clippy::absurd_extreme_comparisons)]
15803 #[allow(unused_comparisons)]
15804 if __tmp.remaining() < Self::ENCODED_LEN {
15805 panic!(
15806 "buffer is too small (need {} bytes, but got {})",
15807 Self::ENCODED_LEN,
15808 __tmp.remaining(),
15809 )
15810 }
15811 __tmp.put_u64_le(self.time_usec);
15812 __tmp.put_u64_le(self.flags.bits() as u64);
15813 for val in &self.controls {
15814 __tmp.put_f32_le(*val);
15815 }
15816 __tmp.put_u8(self.mode.bits() as u8);
15817 if matches!(version, MavlinkVersion::V2) {
15818 let len = __tmp.len();
15819 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15820 } else {
15821 __tmp.len()
15822 }
15823 }
15824}
15825#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15826#[doc = ""]
15827#[doc = "ID: 91"]
15828#[derive(Debug, Clone, PartialEq)]
15829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15831#[cfg_attr(feature = "ts", derive(TS))]
15832#[cfg_attr(feature = "ts", ts(export))]
15833pub struct HIL_CONTROLS_DATA {
15834 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15835 pub time_usec: u64,
15836 #[doc = "Control output -1 .. 1"]
15837 pub roll_ailerons: f32,
15838 #[doc = "Control output -1 .. 1"]
15839 pub pitch_elevator: f32,
15840 #[doc = "Control output -1 .. 1"]
15841 pub yaw_rudder: f32,
15842 #[doc = "Throttle 0 .. 1"]
15843 pub throttle: f32,
15844 #[doc = "Aux 1, -1 .. 1"]
15845 pub aux1: f32,
15846 #[doc = "Aux 2, -1 .. 1"]
15847 pub aux2: f32,
15848 #[doc = "Aux 3, -1 .. 1"]
15849 pub aux3: f32,
15850 #[doc = "Aux 4, -1 .. 1"]
15851 pub aux4: f32,
15852 #[doc = "System mode."]
15853 pub mode: MavMode,
15854 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15855 pub nav_mode: u8,
15856}
15857impl HIL_CONTROLS_DATA {
15858 pub const ENCODED_LEN: usize = 42usize;
15859 pub const DEFAULT: Self = Self {
15860 time_usec: 0_u64,
15861 roll_ailerons: 0.0_f32,
15862 pitch_elevator: 0.0_f32,
15863 yaw_rudder: 0.0_f32,
15864 throttle: 0.0_f32,
15865 aux1: 0.0_f32,
15866 aux2: 0.0_f32,
15867 aux3: 0.0_f32,
15868 aux4: 0.0_f32,
15869 mode: MavMode::DEFAULT,
15870 nav_mode: 0_u8,
15871 };
15872 #[cfg(feature = "arbitrary")]
15873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15874 use arbitrary::{Arbitrary, Unstructured};
15875 let mut buf = [0u8; 1024];
15876 rng.fill_bytes(&mut buf);
15877 let mut unstructured = Unstructured::new(&buf);
15878 Self::arbitrary(&mut unstructured).unwrap_or_default()
15879 }
15880}
15881impl Default for HIL_CONTROLS_DATA {
15882 fn default() -> Self {
15883 Self::DEFAULT.clone()
15884 }
15885}
15886impl MessageData for HIL_CONTROLS_DATA {
15887 type Message = MavMessage;
15888 const ID: u32 = 91u32;
15889 const NAME: &'static str = "HIL_CONTROLS";
15890 const EXTRA_CRC: u8 = 63u8;
15891 const ENCODED_LEN: usize = 42usize;
15892 fn deser(
15893 _version: MavlinkVersion,
15894 __input: &[u8],
15895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15896 let avail_len = __input.len();
15897 let mut payload_buf = [0; Self::ENCODED_LEN];
15898 let mut buf = if avail_len < Self::ENCODED_LEN {
15899 payload_buf[0..avail_len].copy_from_slice(__input);
15900 Bytes::new(&payload_buf)
15901 } else {
15902 Bytes::new(__input)
15903 };
15904 let mut __struct = Self::default();
15905 __struct.time_usec = buf.get_u64_le()?;
15906 __struct.roll_ailerons = buf.get_f32_le()?;
15907 __struct.pitch_elevator = buf.get_f32_le()?;
15908 __struct.yaw_rudder = buf.get_f32_le()?;
15909 __struct.throttle = buf.get_f32_le()?;
15910 __struct.aux1 = buf.get_f32_le()?;
15911 __struct.aux2 = buf.get_f32_le()?;
15912 __struct.aux3 = buf.get_f32_le()?;
15913 __struct.aux4 = buf.get_f32_le()?;
15914 let tmp = buf.get_u8()?;
15915 __struct.mode =
15916 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15917 enum_type: "MavMode",
15918 value: tmp as u64,
15919 })?;
15920 __struct.nav_mode = buf.get_u8()?;
15921 Ok(__struct)
15922 }
15923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15924 let mut __tmp = BytesMut::new(bytes);
15925 #[allow(clippy::absurd_extreme_comparisons)]
15926 #[allow(unused_comparisons)]
15927 if __tmp.remaining() < Self::ENCODED_LEN {
15928 panic!(
15929 "buffer is too small (need {} bytes, but got {})",
15930 Self::ENCODED_LEN,
15931 __tmp.remaining(),
15932 )
15933 }
15934 __tmp.put_u64_le(self.time_usec);
15935 __tmp.put_f32_le(self.roll_ailerons);
15936 __tmp.put_f32_le(self.pitch_elevator);
15937 __tmp.put_f32_le(self.yaw_rudder);
15938 __tmp.put_f32_le(self.throttle);
15939 __tmp.put_f32_le(self.aux1);
15940 __tmp.put_f32_le(self.aux2);
15941 __tmp.put_f32_le(self.aux3);
15942 __tmp.put_f32_le(self.aux4);
15943 __tmp.put_u8(self.mode as u8);
15944 __tmp.put_u8(self.nav_mode);
15945 if matches!(version, MavlinkVersion::V2) {
15946 let len = __tmp.len();
15947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15948 } else {
15949 __tmp.len()
15950 }
15951 }
15952}
15953#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15954#[doc = ""]
15955#[doc = "ID: 113"]
15956#[derive(Debug, Clone, PartialEq)]
15957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15959#[cfg_attr(feature = "ts", derive(TS))]
15960#[cfg_attr(feature = "ts", ts(export))]
15961pub struct HIL_GPS_DATA {
15962 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15963 pub time_usec: u64,
15964 #[doc = "Latitude (WGS84)"]
15965 pub lat: i32,
15966 #[doc = "Longitude (WGS84)"]
15967 pub lon: i32,
15968 #[doc = "Altitude (MSL). Positive for up."]
15969 pub alt: i32,
15970 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15971 pub eph: u16,
15972 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15973 pub epv: u16,
15974 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15975 pub vel: u16,
15976 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15977 pub vn: i16,
15978 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15979 pub ve: i16,
15980 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15981 pub vd: i16,
15982 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15983 pub cog: u16,
15984 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15985 pub fix_type: u8,
15986 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15987 pub satellites_visible: u8,
15988 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15989 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15990 pub id: u8,
15991 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15992 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15993 pub yaw: u16,
15994}
15995impl HIL_GPS_DATA {
15996 pub const ENCODED_LEN: usize = 39usize;
15997 pub const DEFAULT: Self = Self {
15998 time_usec: 0_u64,
15999 lat: 0_i32,
16000 lon: 0_i32,
16001 alt: 0_i32,
16002 eph: 0_u16,
16003 epv: 0_u16,
16004 vel: 0_u16,
16005 vn: 0_i16,
16006 ve: 0_i16,
16007 vd: 0_i16,
16008 cog: 0_u16,
16009 fix_type: 0_u8,
16010 satellites_visible: 0_u8,
16011 id: 0_u8,
16012 yaw: 0_u16,
16013 };
16014 #[cfg(feature = "arbitrary")]
16015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16016 use arbitrary::{Arbitrary, Unstructured};
16017 let mut buf = [0u8; 1024];
16018 rng.fill_bytes(&mut buf);
16019 let mut unstructured = Unstructured::new(&buf);
16020 Self::arbitrary(&mut unstructured).unwrap_or_default()
16021 }
16022}
16023impl Default for HIL_GPS_DATA {
16024 fn default() -> Self {
16025 Self::DEFAULT.clone()
16026 }
16027}
16028impl MessageData for HIL_GPS_DATA {
16029 type Message = MavMessage;
16030 const ID: u32 = 113u32;
16031 const NAME: &'static str = "HIL_GPS";
16032 const EXTRA_CRC: u8 = 124u8;
16033 const ENCODED_LEN: usize = 39usize;
16034 fn deser(
16035 _version: MavlinkVersion,
16036 __input: &[u8],
16037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16038 let avail_len = __input.len();
16039 let mut payload_buf = [0; Self::ENCODED_LEN];
16040 let mut buf = if avail_len < Self::ENCODED_LEN {
16041 payload_buf[0..avail_len].copy_from_slice(__input);
16042 Bytes::new(&payload_buf)
16043 } else {
16044 Bytes::new(__input)
16045 };
16046 let mut __struct = Self::default();
16047 __struct.time_usec = buf.get_u64_le()?;
16048 __struct.lat = buf.get_i32_le()?;
16049 __struct.lon = buf.get_i32_le()?;
16050 __struct.alt = buf.get_i32_le()?;
16051 __struct.eph = buf.get_u16_le()?;
16052 __struct.epv = buf.get_u16_le()?;
16053 __struct.vel = buf.get_u16_le()?;
16054 __struct.vn = buf.get_i16_le()?;
16055 __struct.ve = buf.get_i16_le()?;
16056 __struct.vd = buf.get_i16_le()?;
16057 __struct.cog = buf.get_u16_le()?;
16058 __struct.fix_type = buf.get_u8()?;
16059 __struct.satellites_visible = buf.get_u8()?;
16060 __struct.id = buf.get_u8()?;
16061 __struct.yaw = buf.get_u16_le()?;
16062 Ok(__struct)
16063 }
16064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16065 let mut __tmp = BytesMut::new(bytes);
16066 #[allow(clippy::absurd_extreme_comparisons)]
16067 #[allow(unused_comparisons)]
16068 if __tmp.remaining() < Self::ENCODED_LEN {
16069 panic!(
16070 "buffer is too small (need {} bytes, but got {})",
16071 Self::ENCODED_LEN,
16072 __tmp.remaining(),
16073 )
16074 }
16075 __tmp.put_u64_le(self.time_usec);
16076 __tmp.put_i32_le(self.lat);
16077 __tmp.put_i32_le(self.lon);
16078 __tmp.put_i32_le(self.alt);
16079 __tmp.put_u16_le(self.eph);
16080 __tmp.put_u16_le(self.epv);
16081 __tmp.put_u16_le(self.vel);
16082 __tmp.put_i16_le(self.vn);
16083 __tmp.put_i16_le(self.ve);
16084 __tmp.put_i16_le(self.vd);
16085 __tmp.put_u16_le(self.cog);
16086 __tmp.put_u8(self.fix_type);
16087 __tmp.put_u8(self.satellites_visible);
16088 if matches!(version, MavlinkVersion::V2) {
16089 __tmp.put_u8(self.id);
16090 __tmp.put_u16_le(self.yaw);
16091 let len = __tmp.len();
16092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16093 } else {
16094 __tmp.len()
16095 }
16096 }
16097}
16098#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16099#[doc = ""]
16100#[doc = "ID: 114"]
16101#[derive(Debug, Clone, PartialEq)]
16102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16103#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16104#[cfg_attr(feature = "ts", derive(TS))]
16105#[cfg_attr(feature = "ts", ts(export))]
16106pub struct HIL_OPTICAL_FLOW_DATA {
16107 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16108 pub time_usec: u64,
16109 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16110 pub integration_time_us: u32,
16111 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16112 pub integrated_x: f32,
16113 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16114 pub integrated_y: f32,
16115 #[doc = "RH rotation around X axis"]
16116 pub integrated_xgyro: f32,
16117 #[doc = "RH rotation around Y axis"]
16118 pub integrated_ygyro: f32,
16119 #[doc = "RH rotation around Z axis"]
16120 pub integrated_zgyro: f32,
16121 #[doc = "Time since the distance was sampled."]
16122 pub time_delta_distance_us: u32,
16123 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16124 pub distance: f32,
16125 #[doc = "Temperature"]
16126 pub temperature: i16,
16127 #[doc = "Sensor ID"]
16128 pub sensor_id: u8,
16129 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16130 pub quality: u8,
16131}
16132impl HIL_OPTICAL_FLOW_DATA {
16133 pub const ENCODED_LEN: usize = 44usize;
16134 pub const DEFAULT: Self = Self {
16135 time_usec: 0_u64,
16136 integration_time_us: 0_u32,
16137 integrated_x: 0.0_f32,
16138 integrated_y: 0.0_f32,
16139 integrated_xgyro: 0.0_f32,
16140 integrated_ygyro: 0.0_f32,
16141 integrated_zgyro: 0.0_f32,
16142 time_delta_distance_us: 0_u32,
16143 distance: 0.0_f32,
16144 temperature: 0_i16,
16145 sensor_id: 0_u8,
16146 quality: 0_u8,
16147 };
16148 #[cfg(feature = "arbitrary")]
16149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16150 use arbitrary::{Arbitrary, Unstructured};
16151 let mut buf = [0u8; 1024];
16152 rng.fill_bytes(&mut buf);
16153 let mut unstructured = Unstructured::new(&buf);
16154 Self::arbitrary(&mut unstructured).unwrap_or_default()
16155 }
16156}
16157impl Default for HIL_OPTICAL_FLOW_DATA {
16158 fn default() -> Self {
16159 Self::DEFAULT.clone()
16160 }
16161}
16162impl MessageData for HIL_OPTICAL_FLOW_DATA {
16163 type Message = MavMessage;
16164 const ID: u32 = 114u32;
16165 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16166 const EXTRA_CRC: u8 = 237u8;
16167 const ENCODED_LEN: usize = 44usize;
16168 fn deser(
16169 _version: MavlinkVersion,
16170 __input: &[u8],
16171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16172 let avail_len = __input.len();
16173 let mut payload_buf = [0; Self::ENCODED_LEN];
16174 let mut buf = if avail_len < Self::ENCODED_LEN {
16175 payload_buf[0..avail_len].copy_from_slice(__input);
16176 Bytes::new(&payload_buf)
16177 } else {
16178 Bytes::new(__input)
16179 };
16180 let mut __struct = Self::default();
16181 __struct.time_usec = buf.get_u64_le()?;
16182 __struct.integration_time_us = buf.get_u32_le()?;
16183 __struct.integrated_x = buf.get_f32_le()?;
16184 __struct.integrated_y = buf.get_f32_le()?;
16185 __struct.integrated_xgyro = buf.get_f32_le()?;
16186 __struct.integrated_ygyro = buf.get_f32_le()?;
16187 __struct.integrated_zgyro = buf.get_f32_le()?;
16188 __struct.time_delta_distance_us = buf.get_u32_le()?;
16189 __struct.distance = buf.get_f32_le()?;
16190 __struct.temperature = buf.get_i16_le()?;
16191 __struct.sensor_id = buf.get_u8()?;
16192 __struct.quality = buf.get_u8()?;
16193 Ok(__struct)
16194 }
16195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16196 let mut __tmp = BytesMut::new(bytes);
16197 #[allow(clippy::absurd_extreme_comparisons)]
16198 #[allow(unused_comparisons)]
16199 if __tmp.remaining() < Self::ENCODED_LEN {
16200 panic!(
16201 "buffer is too small (need {} bytes, but got {})",
16202 Self::ENCODED_LEN,
16203 __tmp.remaining(),
16204 )
16205 }
16206 __tmp.put_u64_le(self.time_usec);
16207 __tmp.put_u32_le(self.integration_time_us);
16208 __tmp.put_f32_le(self.integrated_x);
16209 __tmp.put_f32_le(self.integrated_y);
16210 __tmp.put_f32_le(self.integrated_xgyro);
16211 __tmp.put_f32_le(self.integrated_ygyro);
16212 __tmp.put_f32_le(self.integrated_zgyro);
16213 __tmp.put_u32_le(self.time_delta_distance_us);
16214 __tmp.put_f32_le(self.distance);
16215 __tmp.put_i16_le(self.temperature);
16216 __tmp.put_u8(self.sensor_id);
16217 __tmp.put_u8(self.quality);
16218 if matches!(version, MavlinkVersion::V2) {
16219 let len = __tmp.len();
16220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16221 } else {
16222 __tmp.len()
16223 }
16224 }
16225}
16226#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16227#[doc = ""]
16228#[doc = "ID: 92"]
16229#[derive(Debug, Clone, PartialEq)]
16230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16232#[cfg_attr(feature = "ts", derive(TS))]
16233#[cfg_attr(feature = "ts", ts(export))]
16234pub struct HIL_RC_INPUTS_RAW_DATA {
16235 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16236 pub time_usec: u64,
16237 #[doc = "RC channel 1 value"]
16238 pub chan1_raw: u16,
16239 #[doc = "RC channel 2 value"]
16240 pub chan2_raw: u16,
16241 #[doc = "RC channel 3 value"]
16242 pub chan3_raw: u16,
16243 #[doc = "RC channel 4 value"]
16244 pub chan4_raw: u16,
16245 #[doc = "RC channel 5 value"]
16246 pub chan5_raw: u16,
16247 #[doc = "RC channel 6 value"]
16248 pub chan6_raw: u16,
16249 #[doc = "RC channel 7 value"]
16250 pub chan7_raw: u16,
16251 #[doc = "RC channel 8 value"]
16252 pub chan8_raw: u16,
16253 #[doc = "RC channel 9 value"]
16254 pub chan9_raw: u16,
16255 #[doc = "RC channel 10 value"]
16256 pub chan10_raw: u16,
16257 #[doc = "RC channel 11 value"]
16258 pub chan11_raw: u16,
16259 #[doc = "RC channel 12 value"]
16260 pub chan12_raw: u16,
16261 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16262 pub rssi: u8,
16263}
16264impl HIL_RC_INPUTS_RAW_DATA {
16265 pub const ENCODED_LEN: usize = 33usize;
16266 pub const DEFAULT: Self = Self {
16267 time_usec: 0_u64,
16268 chan1_raw: 0_u16,
16269 chan2_raw: 0_u16,
16270 chan3_raw: 0_u16,
16271 chan4_raw: 0_u16,
16272 chan5_raw: 0_u16,
16273 chan6_raw: 0_u16,
16274 chan7_raw: 0_u16,
16275 chan8_raw: 0_u16,
16276 chan9_raw: 0_u16,
16277 chan10_raw: 0_u16,
16278 chan11_raw: 0_u16,
16279 chan12_raw: 0_u16,
16280 rssi: 0_u8,
16281 };
16282 #[cfg(feature = "arbitrary")]
16283 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16284 use arbitrary::{Arbitrary, Unstructured};
16285 let mut buf = [0u8; 1024];
16286 rng.fill_bytes(&mut buf);
16287 let mut unstructured = Unstructured::new(&buf);
16288 Self::arbitrary(&mut unstructured).unwrap_or_default()
16289 }
16290}
16291impl Default for HIL_RC_INPUTS_RAW_DATA {
16292 fn default() -> Self {
16293 Self::DEFAULT.clone()
16294 }
16295}
16296impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16297 type Message = MavMessage;
16298 const ID: u32 = 92u32;
16299 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16300 const EXTRA_CRC: u8 = 54u8;
16301 const ENCODED_LEN: usize = 33usize;
16302 fn deser(
16303 _version: MavlinkVersion,
16304 __input: &[u8],
16305 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16306 let avail_len = __input.len();
16307 let mut payload_buf = [0; Self::ENCODED_LEN];
16308 let mut buf = if avail_len < Self::ENCODED_LEN {
16309 payload_buf[0..avail_len].copy_from_slice(__input);
16310 Bytes::new(&payload_buf)
16311 } else {
16312 Bytes::new(__input)
16313 };
16314 let mut __struct = Self::default();
16315 __struct.time_usec = buf.get_u64_le()?;
16316 __struct.chan1_raw = buf.get_u16_le()?;
16317 __struct.chan2_raw = buf.get_u16_le()?;
16318 __struct.chan3_raw = buf.get_u16_le()?;
16319 __struct.chan4_raw = buf.get_u16_le()?;
16320 __struct.chan5_raw = buf.get_u16_le()?;
16321 __struct.chan6_raw = buf.get_u16_le()?;
16322 __struct.chan7_raw = buf.get_u16_le()?;
16323 __struct.chan8_raw = buf.get_u16_le()?;
16324 __struct.chan9_raw = buf.get_u16_le()?;
16325 __struct.chan10_raw = buf.get_u16_le()?;
16326 __struct.chan11_raw = buf.get_u16_le()?;
16327 __struct.chan12_raw = buf.get_u16_le()?;
16328 __struct.rssi = buf.get_u8()?;
16329 Ok(__struct)
16330 }
16331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16332 let mut __tmp = BytesMut::new(bytes);
16333 #[allow(clippy::absurd_extreme_comparisons)]
16334 #[allow(unused_comparisons)]
16335 if __tmp.remaining() < Self::ENCODED_LEN {
16336 panic!(
16337 "buffer is too small (need {} bytes, but got {})",
16338 Self::ENCODED_LEN,
16339 __tmp.remaining(),
16340 )
16341 }
16342 __tmp.put_u64_le(self.time_usec);
16343 __tmp.put_u16_le(self.chan1_raw);
16344 __tmp.put_u16_le(self.chan2_raw);
16345 __tmp.put_u16_le(self.chan3_raw);
16346 __tmp.put_u16_le(self.chan4_raw);
16347 __tmp.put_u16_le(self.chan5_raw);
16348 __tmp.put_u16_le(self.chan6_raw);
16349 __tmp.put_u16_le(self.chan7_raw);
16350 __tmp.put_u16_le(self.chan8_raw);
16351 __tmp.put_u16_le(self.chan9_raw);
16352 __tmp.put_u16_le(self.chan10_raw);
16353 __tmp.put_u16_le(self.chan11_raw);
16354 __tmp.put_u16_le(self.chan12_raw);
16355 __tmp.put_u8(self.rssi);
16356 if matches!(version, MavlinkVersion::V2) {
16357 let len = __tmp.len();
16358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16359 } else {
16360 __tmp.len()
16361 }
16362 }
16363}
16364#[doc = "The IMU readings in SI units in NED body frame."]
16365#[doc = ""]
16366#[doc = "ID: 107"]
16367#[derive(Debug, Clone, PartialEq)]
16368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16370#[cfg_attr(feature = "ts", derive(TS))]
16371#[cfg_attr(feature = "ts", ts(export))]
16372pub struct HIL_SENSOR_DATA {
16373 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16374 pub time_usec: u64,
16375 #[doc = "X acceleration"]
16376 pub xacc: f32,
16377 #[doc = "Y acceleration"]
16378 pub yacc: f32,
16379 #[doc = "Z acceleration"]
16380 pub zacc: f32,
16381 #[doc = "Angular speed around X axis in body frame"]
16382 pub xgyro: f32,
16383 #[doc = "Angular speed around Y axis in body frame"]
16384 pub ygyro: f32,
16385 #[doc = "Angular speed around Z axis in body frame"]
16386 pub zgyro: f32,
16387 #[doc = "X Magnetic field"]
16388 pub xmag: f32,
16389 #[doc = "Y Magnetic field"]
16390 pub ymag: f32,
16391 #[doc = "Z Magnetic field"]
16392 pub zmag: f32,
16393 #[doc = "Absolute pressure"]
16394 pub abs_pressure: f32,
16395 #[doc = "Differential pressure (airspeed)"]
16396 pub diff_pressure: f32,
16397 #[doc = "Altitude calculated from pressure"]
16398 pub pressure_alt: f32,
16399 #[doc = "Temperature"]
16400 pub temperature: f32,
16401 #[doc = "Bitmap for fields that have updated since last message"]
16402 pub fields_updated: HilSensorUpdatedFlags,
16403 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16404 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16405 pub id: u8,
16406}
16407impl HIL_SENSOR_DATA {
16408 pub const ENCODED_LEN: usize = 65usize;
16409 pub const DEFAULT: Self = Self {
16410 time_usec: 0_u64,
16411 xacc: 0.0_f32,
16412 yacc: 0.0_f32,
16413 zacc: 0.0_f32,
16414 xgyro: 0.0_f32,
16415 ygyro: 0.0_f32,
16416 zgyro: 0.0_f32,
16417 xmag: 0.0_f32,
16418 ymag: 0.0_f32,
16419 zmag: 0.0_f32,
16420 abs_pressure: 0.0_f32,
16421 diff_pressure: 0.0_f32,
16422 pressure_alt: 0.0_f32,
16423 temperature: 0.0_f32,
16424 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16425 id: 0_u8,
16426 };
16427 #[cfg(feature = "arbitrary")]
16428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16429 use arbitrary::{Arbitrary, Unstructured};
16430 let mut buf = [0u8; 1024];
16431 rng.fill_bytes(&mut buf);
16432 let mut unstructured = Unstructured::new(&buf);
16433 Self::arbitrary(&mut unstructured).unwrap_or_default()
16434 }
16435}
16436impl Default for HIL_SENSOR_DATA {
16437 fn default() -> Self {
16438 Self::DEFAULT.clone()
16439 }
16440}
16441impl MessageData for HIL_SENSOR_DATA {
16442 type Message = MavMessage;
16443 const ID: u32 = 107u32;
16444 const NAME: &'static str = "HIL_SENSOR";
16445 const EXTRA_CRC: u8 = 108u8;
16446 const ENCODED_LEN: usize = 65usize;
16447 fn deser(
16448 _version: MavlinkVersion,
16449 __input: &[u8],
16450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16451 let avail_len = __input.len();
16452 let mut payload_buf = [0; Self::ENCODED_LEN];
16453 let mut buf = if avail_len < Self::ENCODED_LEN {
16454 payload_buf[0..avail_len].copy_from_slice(__input);
16455 Bytes::new(&payload_buf)
16456 } else {
16457 Bytes::new(__input)
16458 };
16459 let mut __struct = Self::default();
16460 __struct.time_usec = buf.get_u64_le()?;
16461 __struct.xacc = buf.get_f32_le()?;
16462 __struct.yacc = buf.get_f32_le()?;
16463 __struct.zacc = buf.get_f32_le()?;
16464 __struct.xgyro = buf.get_f32_le()?;
16465 __struct.ygyro = buf.get_f32_le()?;
16466 __struct.zgyro = buf.get_f32_le()?;
16467 __struct.xmag = buf.get_f32_le()?;
16468 __struct.ymag = buf.get_f32_le()?;
16469 __struct.zmag = buf.get_f32_le()?;
16470 __struct.abs_pressure = buf.get_f32_le()?;
16471 __struct.diff_pressure = buf.get_f32_le()?;
16472 __struct.pressure_alt = buf.get_f32_le()?;
16473 __struct.temperature = buf.get_f32_le()?;
16474 let tmp = buf.get_u32_le()?;
16475 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16476 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
16477 )
16478 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16479 flag_type: "HilSensorUpdatedFlags",
16480 value: tmp as u64,
16481 })?;
16482 __struct.id = buf.get_u8()?;
16483 Ok(__struct)
16484 }
16485 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16486 let mut __tmp = BytesMut::new(bytes);
16487 #[allow(clippy::absurd_extreme_comparisons)]
16488 #[allow(unused_comparisons)]
16489 if __tmp.remaining() < Self::ENCODED_LEN {
16490 panic!(
16491 "buffer is too small (need {} bytes, but got {})",
16492 Self::ENCODED_LEN,
16493 __tmp.remaining(),
16494 )
16495 }
16496 __tmp.put_u64_le(self.time_usec);
16497 __tmp.put_f32_le(self.xacc);
16498 __tmp.put_f32_le(self.yacc);
16499 __tmp.put_f32_le(self.zacc);
16500 __tmp.put_f32_le(self.xgyro);
16501 __tmp.put_f32_le(self.ygyro);
16502 __tmp.put_f32_le(self.zgyro);
16503 __tmp.put_f32_le(self.xmag);
16504 __tmp.put_f32_le(self.ymag);
16505 __tmp.put_f32_le(self.zmag);
16506 __tmp.put_f32_le(self.abs_pressure);
16507 __tmp.put_f32_le(self.diff_pressure);
16508 __tmp.put_f32_le(self.pressure_alt);
16509 __tmp.put_f32_le(self.temperature);
16510 __tmp.put_u32_le(self.fields_updated.bits() as u32);
16511 if matches!(version, MavlinkVersion::V2) {
16512 __tmp.put_u8(self.id);
16513 let len = __tmp.len();
16514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16515 } else {
16516 __tmp.len()
16517 }
16518 }
16519}
16520#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16521#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16522#[doc = ""]
16523#[doc = "ID: 90"]
16524#[derive(Debug, Clone, PartialEq)]
16525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16527#[cfg_attr(feature = "ts", derive(TS))]
16528#[cfg_attr(feature = "ts", ts(export))]
16529pub struct HIL_STATE_DATA {
16530 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16531 pub time_usec: u64,
16532 #[doc = "Roll angle"]
16533 pub roll: f32,
16534 #[doc = "Pitch angle"]
16535 pub pitch: f32,
16536 #[doc = "Yaw angle"]
16537 pub yaw: f32,
16538 #[doc = "Body frame roll / phi angular speed"]
16539 pub rollspeed: f32,
16540 #[doc = "Body frame pitch / theta angular speed"]
16541 pub pitchspeed: f32,
16542 #[doc = "Body frame yaw / psi angular speed"]
16543 pub yawspeed: f32,
16544 #[doc = "Latitude"]
16545 pub lat: i32,
16546 #[doc = "Longitude"]
16547 pub lon: i32,
16548 #[doc = "Altitude"]
16549 pub alt: i32,
16550 #[doc = "Ground X Speed (Latitude)"]
16551 pub vx: i16,
16552 #[doc = "Ground Y Speed (Longitude)"]
16553 pub vy: i16,
16554 #[doc = "Ground Z Speed (Altitude)"]
16555 pub vz: i16,
16556 #[doc = "X acceleration"]
16557 pub xacc: i16,
16558 #[doc = "Y acceleration"]
16559 pub yacc: i16,
16560 #[doc = "Z acceleration"]
16561 pub zacc: i16,
16562}
16563impl HIL_STATE_DATA {
16564 pub const ENCODED_LEN: usize = 56usize;
16565 pub const DEFAULT: Self = Self {
16566 time_usec: 0_u64,
16567 roll: 0.0_f32,
16568 pitch: 0.0_f32,
16569 yaw: 0.0_f32,
16570 rollspeed: 0.0_f32,
16571 pitchspeed: 0.0_f32,
16572 yawspeed: 0.0_f32,
16573 lat: 0_i32,
16574 lon: 0_i32,
16575 alt: 0_i32,
16576 vx: 0_i16,
16577 vy: 0_i16,
16578 vz: 0_i16,
16579 xacc: 0_i16,
16580 yacc: 0_i16,
16581 zacc: 0_i16,
16582 };
16583 #[cfg(feature = "arbitrary")]
16584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16585 use arbitrary::{Arbitrary, Unstructured};
16586 let mut buf = [0u8; 1024];
16587 rng.fill_bytes(&mut buf);
16588 let mut unstructured = Unstructured::new(&buf);
16589 Self::arbitrary(&mut unstructured).unwrap_or_default()
16590 }
16591}
16592impl Default for HIL_STATE_DATA {
16593 fn default() -> Self {
16594 Self::DEFAULT.clone()
16595 }
16596}
16597impl MessageData for HIL_STATE_DATA {
16598 type Message = MavMessage;
16599 const ID: u32 = 90u32;
16600 const NAME: &'static str = "HIL_STATE";
16601 const EXTRA_CRC: u8 = 183u8;
16602 const ENCODED_LEN: usize = 56usize;
16603 fn deser(
16604 _version: MavlinkVersion,
16605 __input: &[u8],
16606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16607 let avail_len = __input.len();
16608 let mut payload_buf = [0; Self::ENCODED_LEN];
16609 let mut buf = if avail_len < Self::ENCODED_LEN {
16610 payload_buf[0..avail_len].copy_from_slice(__input);
16611 Bytes::new(&payload_buf)
16612 } else {
16613 Bytes::new(__input)
16614 };
16615 let mut __struct = Self::default();
16616 __struct.time_usec = buf.get_u64_le()?;
16617 __struct.roll = buf.get_f32_le()?;
16618 __struct.pitch = buf.get_f32_le()?;
16619 __struct.yaw = buf.get_f32_le()?;
16620 __struct.rollspeed = buf.get_f32_le()?;
16621 __struct.pitchspeed = buf.get_f32_le()?;
16622 __struct.yawspeed = buf.get_f32_le()?;
16623 __struct.lat = buf.get_i32_le()?;
16624 __struct.lon = buf.get_i32_le()?;
16625 __struct.alt = buf.get_i32_le()?;
16626 __struct.vx = buf.get_i16_le()?;
16627 __struct.vy = buf.get_i16_le()?;
16628 __struct.vz = buf.get_i16_le()?;
16629 __struct.xacc = buf.get_i16_le()?;
16630 __struct.yacc = buf.get_i16_le()?;
16631 __struct.zacc = buf.get_i16_le()?;
16632 Ok(__struct)
16633 }
16634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16635 let mut __tmp = BytesMut::new(bytes);
16636 #[allow(clippy::absurd_extreme_comparisons)]
16637 #[allow(unused_comparisons)]
16638 if __tmp.remaining() < Self::ENCODED_LEN {
16639 panic!(
16640 "buffer is too small (need {} bytes, but got {})",
16641 Self::ENCODED_LEN,
16642 __tmp.remaining(),
16643 )
16644 }
16645 __tmp.put_u64_le(self.time_usec);
16646 __tmp.put_f32_le(self.roll);
16647 __tmp.put_f32_le(self.pitch);
16648 __tmp.put_f32_le(self.yaw);
16649 __tmp.put_f32_le(self.rollspeed);
16650 __tmp.put_f32_le(self.pitchspeed);
16651 __tmp.put_f32_le(self.yawspeed);
16652 __tmp.put_i32_le(self.lat);
16653 __tmp.put_i32_le(self.lon);
16654 __tmp.put_i32_le(self.alt);
16655 __tmp.put_i16_le(self.vx);
16656 __tmp.put_i16_le(self.vy);
16657 __tmp.put_i16_le(self.vz);
16658 __tmp.put_i16_le(self.xacc);
16659 __tmp.put_i16_le(self.yacc);
16660 __tmp.put_i16_le(self.zacc);
16661 if matches!(version, MavlinkVersion::V2) {
16662 let len = __tmp.len();
16663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16664 } else {
16665 __tmp.len()
16666 }
16667 }
16668}
16669#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16670#[doc = ""]
16671#[doc = "ID: 115"]
16672#[derive(Debug, Clone, PartialEq)]
16673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16675#[cfg_attr(feature = "ts", derive(TS))]
16676#[cfg_attr(feature = "ts", ts(export))]
16677pub struct HIL_STATE_QUATERNION_DATA {
16678 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16679 pub time_usec: u64,
16680 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16682 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16683 pub attitude_quaternion: [f32; 4],
16684 #[doc = "Body frame roll / phi angular speed"]
16685 pub rollspeed: f32,
16686 #[doc = "Body frame pitch / theta angular speed"]
16687 pub pitchspeed: f32,
16688 #[doc = "Body frame yaw / psi angular speed"]
16689 pub yawspeed: f32,
16690 #[doc = "Latitude"]
16691 pub lat: i32,
16692 #[doc = "Longitude"]
16693 pub lon: i32,
16694 #[doc = "Altitude"]
16695 pub alt: i32,
16696 #[doc = "Ground X Speed (Latitude)"]
16697 pub vx: i16,
16698 #[doc = "Ground Y Speed (Longitude)"]
16699 pub vy: i16,
16700 #[doc = "Ground Z Speed (Altitude)"]
16701 pub vz: i16,
16702 #[doc = "Indicated airspeed"]
16703 pub ind_airspeed: u16,
16704 #[doc = "True airspeed"]
16705 pub true_airspeed: u16,
16706 #[doc = "X acceleration"]
16707 pub xacc: i16,
16708 #[doc = "Y acceleration"]
16709 pub yacc: i16,
16710 #[doc = "Z acceleration"]
16711 pub zacc: i16,
16712}
16713impl HIL_STATE_QUATERNION_DATA {
16714 pub const ENCODED_LEN: usize = 64usize;
16715 pub const DEFAULT: Self = Self {
16716 time_usec: 0_u64,
16717 attitude_quaternion: [0.0_f32; 4usize],
16718 rollspeed: 0.0_f32,
16719 pitchspeed: 0.0_f32,
16720 yawspeed: 0.0_f32,
16721 lat: 0_i32,
16722 lon: 0_i32,
16723 alt: 0_i32,
16724 vx: 0_i16,
16725 vy: 0_i16,
16726 vz: 0_i16,
16727 ind_airspeed: 0_u16,
16728 true_airspeed: 0_u16,
16729 xacc: 0_i16,
16730 yacc: 0_i16,
16731 zacc: 0_i16,
16732 };
16733 #[cfg(feature = "arbitrary")]
16734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16735 use arbitrary::{Arbitrary, Unstructured};
16736 let mut buf = [0u8; 1024];
16737 rng.fill_bytes(&mut buf);
16738 let mut unstructured = Unstructured::new(&buf);
16739 Self::arbitrary(&mut unstructured).unwrap_or_default()
16740 }
16741}
16742impl Default for HIL_STATE_QUATERNION_DATA {
16743 fn default() -> Self {
16744 Self::DEFAULT.clone()
16745 }
16746}
16747impl MessageData for HIL_STATE_QUATERNION_DATA {
16748 type Message = MavMessage;
16749 const ID: u32 = 115u32;
16750 const NAME: &'static str = "HIL_STATE_QUATERNION";
16751 const EXTRA_CRC: u8 = 4u8;
16752 const ENCODED_LEN: usize = 64usize;
16753 fn deser(
16754 _version: MavlinkVersion,
16755 __input: &[u8],
16756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16757 let avail_len = __input.len();
16758 let mut payload_buf = [0; Self::ENCODED_LEN];
16759 let mut buf = if avail_len < Self::ENCODED_LEN {
16760 payload_buf[0..avail_len].copy_from_slice(__input);
16761 Bytes::new(&payload_buf)
16762 } else {
16763 Bytes::new(__input)
16764 };
16765 let mut __struct = Self::default();
16766 __struct.time_usec = buf.get_u64_le()?;
16767 for v in &mut __struct.attitude_quaternion {
16768 let val = buf.get_f32_le()?;
16769 *v = val;
16770 }
16771 __struct.rollspeed = buf.get_f32_le()?;
16772 __struct.pitchspeed = buf.get_f32_le()?;
16773 __struct.yawspeed = buf.get_f32_le()?;
16774 __struct.lat = buf.get_i32_le()?;
16775 __struct.lon = buf.get_i32_le()?;
16776 __struct.alt = buf.get_i32_le()?;
16777 __struct.vx = buf.get_i16_le()?;
16778 __struct.vy = buf.get_i16_le()?;
16779 __struct.vz = buf.get_i16_le()?;
16780 __struct.ind_airspeed = buf.get_u16_le()?;
16781 __struct.true_airspeed = buf.get_u16_le()?;
16782 __struct.xacc = buf.get_i16_le()?;
16783 __struct.yacc = buf.get_i16_le()?;
16784 __struct.zacc = buf.get_i16_le()?;
16785 Ok(__struct)
16786 }
16787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16788 let mut __tmp = BytesMut::new(bytes);
16789 #[allow(clippy::absurd_extreme_comparisons)]
16790 #[allow(unused_comparisons)]
16791 if __tmp.remaining() < Self::ENCODED_LEN {
16792 panic!(
16793 "buffer is too small (need {} bytes, but got {})",
16794 Self::ENCODED_LEN,
16795 __tmp.remaining(),
16796 )
16797 }
16798 __tmp.put_u64_le(self.time_usec);
16799 for val in &self.attitude_quaternion {
16800 __tmp.put_f32_le(*val);
16801 }
16802 __tmp.put_f32_le(self.rollspeed);
16803 __tmp.put_f32_le(self.pitchspeed);
16804 __tmp.put_f32_le(self.yawspeed);
16805 __tmp.put_i32_le(self.lat);
16806 __tmp.put_i32_le(self.lon);
16807 __tmp.put_i32_le(self.alt);
16808 __tmp.put_i16_le(self.vx);
16809 __tmp.put_i16_le(self.vy);
16810 __tmp.put_i16_le(self.vz);
16811 __tmp.put_u16_le(self.ind_airspeed);
16812 __tmp.put_u16_le(self.true_airspeed);
16813 __tmp.put_i16_le(self.xacc);
16814 __tmp.put_i16_le(self.yacc);
16815 __tmp.put_i16_le(self.zacc);
16816 if matches!(version, MavlinkVersion::V2) {
16817 let len = __tmp.len();
16818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16819 } else {
16820 __tmp.len()
16821 }
16822 }
16823}
16824#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16825#[doc = ""]
16826#[doc = "ID: 242"]
16827#[derive(Debug, Clone, PartialEq)]
16828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16830#[cfg_attr(feature = "ts", derive(TS))]
16831#[cfg_attr(feature = "ts", ts(export))]
16832pub struct HOME_POSITION_DATA {
16833 #[doc = "Latitude (WGS84)"]
16834 pub latitude: i32,
16835 #[doc = "Longitude (WGS84)"]
16836 pub longitude: i32,
16837 #[doc = "Altitude (MSL). Positive for up."]
16838 pub altitude: i32,
16839 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16840 pub x: f32,
16841 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16842 pub y: f32,
16843 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16844 pub z: f32,
16845 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16846 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16847 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16848 pub q: [f32; 4],
16849 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16850 pub approach_x: f32,
16851 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16852 pub approach_y: f32,
16853 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16854 pub approach_z: f32,
16855 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16856 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16857 pub time_usec: u64,
16858}
16859impl HOME_POSITION_DATA {
16860 pub const ENCODED_LEN: usize = 60usize;
16861 pub const DEFAULT: Self = Self {
16862 latitude: 0_i32,
16863 longitude: 0_i32,
16864 altitude: 0_i32,
16865 x: 0.0_f32,
16866 y: 0.0_f32,
16867 z: 0.0_f32,
16868 q: [0.0_f32; 4usize],
16869 approach_x: 0.0_f32,
16870 approach_y: 0.0_f32,
16871 approach_z: 0.0_f32,
16872 time_usec: 0_u64,
16873 };
16874 #[cfg(feature = "arbitrary")]
16875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16876 use arbitrary::{Arbitrary, Unstructured};
16877 let mut buf = [0u8; 1024];
16878 rng.fill_bytes(&mut buf);
16879 let mut unstructured = Unstructured::new(&buf);
16880 Self::arbitrary(&mut unstructured).unwrap_or_default()
16881 }
16882}
16883impl Default for HOME_POSITION_DATA {
16884 fn default() -> Self {
16885 Self::DEFAULT.clone()
16886 }
16887}
16888impl MessageData for HOME_POSITION_DATA {
16889 type Message = MavMessage;
16890 const ID: u32 = 242u32;
16891 const NAME: &'static str = "HOME_POSITION";
16892 const EXTRA_CRC: u8 = 104u8;
16893 const ENCODED_LEN: usize = 60usize;
16894 fn deser(
16895 _version: MavlinkVersion,
16896 __input: &[u8],
16897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16898 let avail_len = __input.len();
16899 let mut payload_buf = [0; Self::ENCODED_LEN];
16900 let mut buf = if avail_len < Self::ENCODED_LEN {
16901 payload_buf[0..avail_len].copy_from_slice(__input);
16902 Bytes::new(&payload_buf)
16903 } else {
16904 Bytes::new(__input)
16905 };
16906 let mut __struct = Self::default();
16907 __struct.latitude = buf.get_i32_le()?;
16908 __struct.longitude = buf.get_i32_le()?;
16909 __struct.altitude = buf.get_i32_le()?;
16910 __struct.x = buf.get_f32_le()?;
16911 __struct.y = buf.get_f32_le()?;
16912 __struct.z = buf.get_f32_le()?;
16913 for v in &mut __struct.q {
16914 let val = buf.get_f32_le()?;
16915 *v = val;
16916 }
16917 __struct.approach_x = buf.get_f32_le()?;
16918 __struct.approach_y = buf.get_f32_le()?;
16919 __struct.approach_z = buf.get_f32_le()?;
16920 __struct.time_usec = buf.get_u64_le()?;
16921 Ok(__struct)
16922 }
16923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16924 let mut __tmp = BytesMut::new(bytes);
16925 #[allow(clippy::absurd_extreme_comparisons)]
16926 #[allow(unused_comparisons)]
16927 if __tmp.remaining() < Self::ENCODED_LEN {
16928 panic!(
16929 "buffer is too small (need {} bytes, but got {})",
16930 Self::ENCODED_LEN,
16931 __tmp.remaining(),
16932 )
16933 }
16934 __tmp.put_i32_le(self.latitude);
16935 __tmp.put_i32_le(self.longitude);
16936 __tmp.put_i32_le(self.altitude);
16937 __tmp.put_f32_le(self.x);
16938 __tmp.put_f32_le(self.y);
16939 __tmp.put_f32_le(self.z);
16940 for val in &self.q {
16941 __tmp.put_f32_le(*val);
16942 }
16943 __tmp.put_f32_le(self.approach_x);
16944 __tmp.put_f32_le(self.approach_y);
16945 __tmp.put_f32_le(self.approach_z);
16946 if matches!(version, MavlinkVersion::V2) {
16947 __tmp.put_u64_le(self.time_usec);
16948 let len = __tmp.len();
16949 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16950 } else {
16951 __tmp.len()
16952 }
16953 }
16954}
16955#[doc = "Temperature and humidity from hygrometer."]
16956#[doc = ""]
16957#[doc = "ID: 12920"]
16958#[derive(Debug, Clone, PartialEq)]
16959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16961#[cfg_attr(feature = "ts", derive(TS))]
16962#[cfg_attr(feature = "ts", ts(export))]
16963pub struct HYGROMETER_SENSOR_DATA {
16964 #[doc = "Temperature"]
16965 pub temperature: i16,
16966 #[doc = "Humidity"]
16967 pub humidity: u16,
16968 #[doc = "Hygrometer ID"]
16969 pub id: u8,
16970}
16971impl HYGROMETER_SENSOR_DATA {
16972 pub const ENCODED_LEN: usize = 5usize;
16973 pub const DEFAULT: Self = Self {
16974 temperature: 0_i16,
16975 humidity: 0_u16,
16976 id: 0_u8,
16977 };
16978 #[cfg(feature = "arbitrary")]
16979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16980 use arbitrary::{Arbitrary, Unstructured};
16981 let mut buf = [0u8; 1024];
16982 rng.fill_bytes(&mut buf);
16983 let mut unstructured = Unstructured::new(&buf);
16984 Self::arbitrary(&mut unstructured).unwrap_or_default()
16985 }
16986}
16987impl Default for HYGROMETER_SENSOR_DATA {
16988 fn default() -> Self {
16989 Self::DEFAULT.clone()
16990 }
16991}
16992impl MessageData for HYGROMETER_SENSOR_DATA {
16993 type Message = MavMessage;
16994 const ID: u32 = 12920u32;
16995 const NAME: &'static str = "HYGROMETER_SENSOR";
16996 const EXTRA_CRC: u8 = 20u8;
16997 const ENCODED_LEN: usize = 5usize;
16998 fn deser(
16999 _version: MavlinkVersion,
17000 __input: &[u8],
17001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17002 let avail_len = __input.len();
17003 let mut payload_buf = [0; Self::ENCODED_LEN];
17004 let mut buf = if avail_len < Self::ENCODED_LEN {
17005 payload_buf[0..avail_len].copy_from_slice(__input);
17006 Bytes::new(&payload_buf)
17007 } else {
17008 Bytes::new(__input)
17009 };
17010 let mut __struct = Self::default();
17011 __struct.temperature = buf.get_i16_le()?;
17012 __struct.humidity = buf.get_u16_le()?;
17013 __struct.id = buf.get_u8()?;
17014 Ok(__struct)
17015 }
17016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17017 let mut __tmp = BytesMut::new(bytes);
17018 #[allow(clippy::absurd_extreme_comparisons)]
17019 #[allow(unused_comparisons)]
17020 if __tmp.remaining() < Self::ENCODED_LEN {
17021 panic!(
17022 "buffer is too small (need {} bytes, but got {})",
17023 Self::ENCODED_LEN,
17024 __tmp.remaining(),
17025 )
17026 }
17027 __tmp.put_i16_le(self.temperature);
17028 __tmp.put_u16_le(self.humidity);
17029 __tmp.put_u8(self.id);
17030 if matches!(version, MavlinkVersion::V2) {
17031 let len = __tmp.len();
17032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17033 } else {
17034 __tmp.len()
17035 }
17036 }
17037}
17038#[doc = "Illuminator status."]
17039#[doc = ""]
17040#[doc = "ID: 440"]
17041#[derive(Debug, Clone, PartialEq)]
17042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17044#[cfg_attr(feature = "ts", derive(TS))]
17045#[cfg_attr(feature = "ts", ts(export))]
17046pub struct ILLUMINATOR_STATUS_DATA {
17047 #[doc = "Time since the start-up of the illuminator in ms"]
17048 pub uptime_ms: u32,
17049 #[doc = "Errors"]
17050 pub error_status: IlluminatorErrorFlags,
17051 #[doc = "Illuminator brightness"]
17052 pub brightness: f32,
17053 #[doc = "Illuminator strobing period in seconds"]
17054 pub strobe_period: f32,
17055 #[doc = "Illuminator strobing duty cycle"]
17056 pub strobe_duty_cycle: f32,
17057 #[doc = "Temperature in Celsius"]
17058 pub temp_c: f32,
17059 #[doc = "Minimum strobing period in seconds"]
17060 pub min_strobe_period: f32,
17061 #[doc = "Maximum strobing period in seconds"]
17062 pub max_strobe_period: f32,
17063 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17064 pub enable: u8,
17065 #[doc = "Supported illuminator modes"]
17066 pub mode_bitmask: IlluminatorMode,
17067 #[doc = "Illuminator mode"]
17068 pub mode: IlluminatorMode,
17069}
17070impl ILLUMINATOR_STATUS_DATA {
17071 pub const ENCODED_LEN: usize = 35usize;
17072 pub const DEFAULT: Self = Self {
17073 uptime_ms: 0_u32,
17074 error_status: IlluminatorErrorFlags::DEFAULT,
17075 brightness: 0.0_f32,
17076 strobe_period: 0.0_f32,
17077 strobe_duty_cycle: 0.0_f32,
17078 temp_c: 0.0_f32,
17079 min_strobe_period: 0.0_f32,
17080 max_strobe_period: 0.0_f32,
17081 enable: 0_u8,
17082 mode_bitmask: IlluminatorMode::DEFAULT,
17083 mode: IlluminatorMode::DEFAULT,
17084 };
17085 #[cfg(feature = "arbitrary")]
17086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17087 use arbitrary::{Arbitrary, Unstructured};
17088 let mut buf = [0u8; 1024];
17089 rng.fill_bytes(&mut buf);
17090 let mut unstructured = Unstructured::new(&buf);
17091 Self::arbitrary(&mut unstructured).unwrap_or_default()
17092 }
17093}
17094impl Default for ILLUMINATOR_STATUS_DATA {
17095 fn default() -> Self {
17096 Self::DEFAULT.clone()
17097 }
17098}
17099impl MessageData for ILLUMINATOR_STATUS_DATA {
17100 type Message = MavMessage;
17101 const ID: u32 = 440u32;
17102 const NAME: &'static str = "ILLUMINATOR_STATUS";
17103 const EXTRA_CRC: u8 = 66u8;
17104 const ENCODED_LEN: usize = 35usize;
17105 fn deser(
17106 _version: MavlinkVersion,
17107 __input: &[u8],
17108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17109 let avail_len = __input.len();
17110 let mut payload_buf = [0; Self::ENCODED_LEN];
17111 let mut buf = if avail_len < Self::ENCODED_LEN {
17112 payload_buf[0..avail_len].copy_from_slice(__input);
17113 Bytes::new(&payload_buf)
17114 } else {
17115 Bytes::new(__input)
17116 };
17117 let mut __struct = Self::default();
17118 __struct.uptime_ms = buf.get_u32_le()?;
17119 let tmp = buf.get_u32_le()?;
17120 __struct.error_status = IlluminatorErrorFlags::from_bits(
17121 tmp as <IlluminatorErrorFlags as Flags>::Bits,
17122 )
17123 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17124 flag_type: "IlluminatorErrorFlags",
17125 value: tmp as u64,
17126 })?;
17127 __struct.brightness = buf.get_f32_le()?;
17128 __struct.strobe_period = buf.get_f32_le()?;
17129 __struct.strobe_duty_cycle = buf.get_f32_le()?;
17130 __struct.temp_c = buf.get_f32_le()?;
17131 __struct.min_strobe_period = buf.get_f32_le()?;
17132 __struct.max_strobe_period = buf.get_f32_le()?;
17133 __struct.enable = buf.get_u8()?;
17134 let tmp = buf.get_u8()?;
17135 __struct.mode_bitmask =
17136 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17137 enum_type: "IlluminatorMode",
17138 value: tmp as u64,
17139 })?;
17140 let tmp = buf.get_u8()?;
17141 __struct.mode =
17142 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17143 enum_type: "IlluminatorMode",
17144 value: tmp as u64,
17145 })?;
17146 Ok(__struct)
17147 }
17148 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17149 let mut __tmp = BytesMut::new(bytes);
17150 #[allow(clippy::absurd_extreme_comparisons)]
17151 #[allow(unused_comparisons)]
17152 if __tmp.remaining() < Self::ENCODED_LEN {
17153 panic!(
17154 "buffer is too small (need {} bytes, but got {})",
17155 Self::ENCODED_LEN,
17156 __tmp.remaining(),
17157 )
17158 }
17159 __tmp.put_u32_le(self.uptime_ms);
17160 __tmp.put_u32_le(self.error_status.bits() as u32);
17161 __tmp.put_f32_le(self.brightness);
17162 __tmp.put_f32_le(self.strobe_period);
17163 __tmp.put_f32_le(self.strobe_duty_cycle);
17164 __tmp.put_f32_le(self.temp_c);
17165 __tmp.put_f32_le(self.min_strobe_period);
17166 __tmp.put_f32_le(self.max_strobe_period);
17167 __tmp.put_u8(self.enable);
17168 __tmp.put_u8(self.mode_bitmask as u8);
17169 __tmp.put_u8(self.mode as u8);
17170 if matches!(version, MavlinkVersion::V2) {
17171 let len = __tmp.len();
17172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17173 } else {
17174 __tmp.len()
17175 }
17176 }
17177}
17178#[doc = "Status of the Iridium SBD link."]
17179#[doc = ""]
17180#[doc = "ID: 335"]
17181#[derive(Debug, Clone, PartialEq)]
17182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17184#[cfg_attr(feature = "ts", derive(TS))]
17185#[cfg_attr(feature = "ts", ts(export))]
17186pub struct ISBD_LINK_STATUS_DATA {
17187 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17188 pub timestamp: u64,
17189 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17190 pub last_heartbeat: u64,
17191 #[doc = "Number of failed SBD sessions."]
17192 pub failed_sessions: u16,
17193 #[doc = "Number of successful SBD sessions."]
17194 pub successful_sessions: u16,
17195 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17196 pub signal_quality: u8,
17197 #[doc = "1: Ring call pending, 0: No call pending."]
17198 pub ring_pending: u8,
17199 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17200 pub tx_session_pending: u8,
17201 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17202 pub rx_session_pending: u8,
17203}
17204impl ISBD_LINK_STATUS_DATA {
17205 pub const ENCODED_LEN: usize = 24usize;
17206 pub const DEFAULT: Self = Self {
17207 timestamp: 0_u64,
17208 last_heartbeat: 0_u64,
17209 failed_sessions: 0_u16,
17210 successful_sessions: 0_u16,
17211 signal_quality: 0_u8,
17212 ring_pending: 0_u8,
17213 tx_session_pending: 0_u8,
17214 rx_session_pending: 0_u8,
17215 };
17216 #[cfg(feature = "arbitrary")]
17217 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17218 use arbitrary::{Arbitrary, Unstructured};
17219 let mut buf = [0u8; 1024];
17220 rng.fill_bytes(&mut buf);
17221 let mut unstructured = Unstructured::new(&buf);
17222 Self::arbitrary(&mut unstructured).unwrap_or_default()
17223 }
17224}
17225impl Default for ISBD_LINK_STATUS_DATA {
17226 fn default() -> Self {
17227 Self::DEFAULT.clone()
17228 }
17229}
17230impl MessageData for ISBD_LINK_STATUS_DATA {
17231 type Message = MavMessage;
17232 const ID: u32 = 335u32;
17233 const NAME: &'static str = "ISBD_LINK_STATUS";
17234 const EXTRA_CRC: u8 = 225u8;
17235 const ENCODED_LEN: usize = 24usize;
17236 fn deser(
17237 _version: MavlinkVersion,
17238 __input: &[u8],
17239 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17240 let avail_len = __input.len();
17241 let mut payload_buf = [0; Self::ENCODED_LEN];
17242 let mut buf = if avail_len < Self::ENCODED_LEN {
17243 payload_buf[0..avail_len].copy_from_slice(__input);
17244 Bytes::new(&payload_buf)
17245 } else {
17246 Bytes::new(__input)
17247 };
17248 let mut __struct = Self::default();
17249 __struct.timestamp = buf.get_u64_le()?;
17250 __struct.last_heartbeat = buf.get_u64_le()?;
17251 __struct.failed_sessions = buf.get_u16_le()?;
17252 __struct.successful_sessions = buf.get_u16_le()?;
17253 __struct.signal_quality = buf.get_u8()?;
17254 __struct.ring_pending = buf.get_u8()?;
17255 __struct.tx_session_pending = buf.get_u8()?;
17256 __struct.rx_session_pending = buf.get_u8()?;
17257 Ok(__struct)
17258 }
17259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17260 let mut __tmp = BytesMut::new(bytes);
17261 #[allow(clippy::absurd_extreme_comparisons)]
17262 #[allow(unused_comparisons)]
17263 if __tmp.remaining() < Self::ENCODED_LEN {
17264 panic!(
17265 "buffer is too small (need {} bytes, but got {})",
17266 Self::ENCODED_LEN,
17267 __tmp.remaining(),
17268 )
17269 }
17270 __tmp.put_u64_le(self.timestamp);
17271 __tmp.put_u64_le(self.last_heartbeat);
17272 __tmp.put_u16_le(self.failed_sessions);
17273 __tmp.put_u16_le(self.successful_sessions);
17274 __tmp.put_u8(self.signal_quality);
17275 __tmp.put_u8(self.ring_pending);
17276 __tmp.put_u8(self.tx_session_pending);
17277 __tmp.put_u8(self.rx_session_pending);
17278 if matches!(version, MavlinkVersion::V2) {
17279 let len = __tmp.len();
17280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17281 } else {
17282 __tmp.len()
17283 }
17284 }
17285}
17286#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17287#[doc = ""]
17288#[doc = "ID: 149"]
17289#[derive(Debug, Clone, PartialEq)]
17290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17292#[cfg_attr(feature = "ts", derive(TS))]
17293#[cfg_attr(feature = "ts", ts(export))]
17294pub struct LANDING_TARGET_DATA {
17295 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17296 pub time_usec: u64,
17297 #[doc = "X-axis angular offset of the target from the center of the image"]
17298 pub angle_x: f32,
17299 #[doc = "Y-axis angular offset of the target from the center of the image"]
17300 pub angle_y: f32,
17301 #[doc = "Distance to the target from the vehicle"]
17302 pub distance: f32,
17303 #[doc = "Size of target along x-axis"]
17304 pub size_x: f32,
17305 #[doc = "Size of target along y-axis"]
17306 pub size_y: f32,
17307 #[doc = "The ID of the target if multiple targets are present"]
17308 pub target_num: u8,
17309 #[doc = "Coordinate frame used for following fields."]
17310 pub frame: MavFrame,
17311 #[doc = "X Position of the landing target in MAV_FRAME"]
17312 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17313 pub x: f32,
17314 #[doc = "Y Position of the landing target in MAV_FRAME"]
17315 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17316 pub y: f32,
17317 #[doc = "Z Position of the landing target in MAV_FRAME"]
17318 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17319 pub z: f32,
17320 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17321 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17323 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17324 pub q: [f32; 4],
17325 #[doc = "Type of landing target"]
17326 #[cfg_attr(feature = "serde", serde(default))]
17327 pub mavtype: LandingTargetType,
17328 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17330 pub position_valid: u8,
17331}
17332impl LANDING_TARGET_DATA {
17333 pub const ENCODED_LEN: usize = 60usize;
17334 pub const DEFAULT: Self = Self {
17335 time_usec: 0_u64,
17336 angle_x: 0.0_f32,
17337 angle_y: 0.0_f32,
17338 distance: 0.0_f32,
17339 size_x: 0.0_f32,
17340 size_y: 0.0_f32,
17341 target_num: 0_u8,
17342 frame: MavFrame::DEFAULT,
17343 x: 0.0_f32,
17344 y: 0.0_f32,
17345 z: 0.0_f32,
17346 q: [0.0_f32; 4usize],
17347 mavtype: LandingTargetType::DEFAULT,
17348 position_valid: 0_u8,
17349 };
17350 #[cfg(feature = "arbitrary")]
17351 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17352 use arbitrary::{Arbitrary, Unstructured};
17353 let mut buf = [0u8; 1024];
17354 rng.fill_bytes(&mut buf);
17355 let mut unstructured = Unstructured::new(&buf);
17356 Self::arbitrary(&mut unstructured).unwrap_or_default()
17357 }
17358}
17359impl Default for LANDING_TARGET_DATA {
17360 fn default() -> Self {
17361 Self::DEFAULT.clone()
17362 }
17363}
17364impl MessageData for LANDING_TARGET_DATA {
17365 type Message = MavMessage;
17366 const ID: u32 = 149u32;
17367 const NAME: &'static str = "LANDING_TARGET";
17368 const EXTRA_CRC: u8 = 200u8;
17369 const ENCODED_LEN: usize = 60usize;
17370 fn deser(
17371 _version: MavlinkVersion,
17372 __input: &[u8],
17373 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17374 let avail_len = __input.len();
17375 let mut payload_buf = [0; Self::ENCODED_LEN];
17376 let mut buf = if avail_len < Self::ENCODED_LEN {
17377 payload_buf[0..avail_len].copy_from_slice(__input);
17378 Bytes::new(&payload_buf)
17379 } else {
17380 Bytes::new(__input)
17381 };
17382 let mut __struct = Self::default();
17383 __struct.time_usec = buf.get_u64_le()?;
17384 __struct.angle_x = buf.get_f32_le()?;
17385 __struct.angle_y = buf.get_f32_le()?;
17386 __struct.distance = buf.get_f32_le()?;
17387 __struct.size_x = buf.get_f32_le()?;
17388 __struct.size_y = buf.get_f32_le()?;
17389 __struct.target_num = buf.get_u8()?;
17390 let tmp = buf.get_u8()?;
17391 __struct.frame =
17392 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17393 enum_type: "MavFrame",
17394 value: tmp as u64,
17395 })?;
17396 __struct.x = buf.get_f32_le()?;
17397 __struct.y = buf.get_f32_le()?;
17398 __struct.z = buf.get_f32_le()?;
17399 for v in &mut __struct.q {
17400 let val = buf.get_f32_le()?;
17401 *v = val;
17402 }
17403 let tmp = buf.get_u8()?;
17404 __struct.mavtype =
17405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17406 enum_type: "LandingTargetType",
17407 value: tmp as u64,
17408 })?;
17409 __struct.position_valid = buf.get_u8()?;
17410 Ok(__struct)
17411 }
17412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17413 let mut __tmp = BytesMut::new(bytes);
17414 #[allow(clippy::absurd_extreme_comparisons)]
17415 #[allow(unused_comparisons)]
17416 if __tmp.remaining() < Self::ENCODED_LEN {
17417 panic!(
17418 "buffer is too small (need {} bytes, but got {})",
17419 Self::ENCODED_LEN,
17420 __tmp.remaining(),
17421 )
17422 }
17423 __tmp.put_u64_le(self.time_usec);
17424 __tmp.put_f32_le(self.angle_x);
17425 __tmp.put_f32_le(self.angle_y);
17426 __tmp.put_f32_le(self.distance);
17427 __tmp.put_f32_le(self.size_x);
17428 __tmp.put_f32_le(self.size_y);
17429 __tmp.put_u8(self.target_num);
17430 __tmp.put_u8(self.frame as u8);
17431 if matches!(version, MavlinkVersion::V2) {
17432 __tmp.put_f32_le(self.x);
17433 __tmp.put_f32_le(self.y);
17434 __tmp.put_f32_le(self.z);
17435 for val in &self.q {
17436 __tmp.put_f32_le(*val);
17437 }
17438 __tmp.put_u8(self.mavtype as u8);
17439 __tmp.put_u8(self.position_valid);
17440 let len = __tmp.len();
17441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17442 } else {
17443 __tmp.len()
17444 }
17445 }
17446}
17447#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17448#[doc = ""]
17449#[doc = "ID: 8"]
17450#[derive(Debug, Clone, PartialEq)]
17451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17453#[cfg_attr(feature = "ts", derive(TS))]
17454#[cfg_attr(feature = "ts", ts(export))]
17455pub struct LINK_NODE_STATUS_DATA {
17456 #[doc = "Timestamp (time since system boot)."]
17457 pub timestamp: u64,
17458 #[doc = "Transmit rate"]
17459 pub tx_rate: u32,
17460 #[doc = "Receive rate"]
17461 pub rx_rate: u32,
17462 #[doc = "Messages sent"]
17463 pub messages_sent: u32,
17464 #[doc = "Messages received (estimated from counting seq)"]
17465 pub messages_received: u32,
17466 #[doc = "Messages lost (estimated from counting seq)"]
17467 pub messages_lost: u32,
17468 #[doc = "Number of bytes that could not be parsed correctly."]
17469 pub rx_parse_err: u16,
17470 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17471 pub tx_overflows: u16,
17472 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17473 pub rx_overflows: u16,
17474 #[doc = "Remaining free transmit buffer space"]
17475 pub tx_buf: u8,
17476 #[doc = "Remaining free receive buffer space"]
17477 pub rx_buf: u8,
17478}
17479impl LINK_NODE_STATUS_DATA {
17480 pub const ENCODED_LEN: usize = 36usize;
17481 pub const DEFAULT: Self = Self {
17482 timestamp: 0_u64,
17483 tx_rate: 0_u32,
17484 rx_rate: 0_u32,
17485 messages_sent: 0_u32,
17486 messages_received: 0_u32,
17487 messages_lost: 0_u32,
17488 rx_parse_err: 0_u16,
17489 tx_overflows: 0_u16,
17490 rx_overflows: 0_u16,
17491 tx_buf: 0_u8,
17492 rx_buf: 0_u8,
17493 };
17494 #[cfg(feature = "arbitrary")]
17495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17496 use arbitrary::{Arbitrary, Unstructured};
17497 let mut buf = [0u8; 1024];
17498 rng.fill_bytes(&mut buf);
17499 let mut unstructured = Unstructured::new(&buf);
17500 Self::arbitrary(&mut unstructured).unwrap_or_default()
17501 }
17502}
17503impl Default for LINK_NODE_STATUS_DATA {
17504 fn default() -> Self {
17505 Self::DEFAULT.clone()
17506 }
17507}
17508impl MessageData for LINK_NODE_STATUS_DATA {
17509 type Message = MavMessage;
17510 const ID: u32 = 8u32;
17511 const NAME: &'static str = "LINK_NODE_STATUS";
17512 const EXTRA_CRC: u8 = 117u8;
17513 const ENCODED_LEN: usize = 36usize;
17514 fn deser(
17515 _version: MavlinkVersion,
17516 __input: &[u8],
17517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17518 let avail_len = __input.len();
17519 let mut payload_buf = [0; Self::ENCODED_LEN];
17520 let mut buf = if avail_len < Self::ENCODED_LEN {
17521 payload_buf[0..avail_len].copy_from_slice(__input);
17522 Bytes::new(&payload_buf)
17523 } else {
17524 Bytes::new(__input)
17525 };
17526 let mut __struct = Self::default();
17527 __struct.timestamp = buf.get_u64_le()?;
17528 __struct.tx_rate = buf.get_u32_le()?;
17529 __struct.rx_rate = buf.get_u32_le()?;
17530 __struct.messages_sent = buf.get_u32_le()?;
17531 __struct.messages_received = buf.get_u32_le()?;
17532 __struct.messages_lost = buf.get_u32_le()?;
17533 __struct.rx_parse_err = buf.get_u16_le()?;
17534 __struct.tx_overflows = buf.get_u16_le()?;
17535 __struct.rx_overflows = buf.get_u16_le()?;
17536 __struct.tx_buf = buf.get_u8()?;
17537 __struct.rx_buf = buf.get_u8()?;
17538 Ok(__struct)
17539 }
17540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17541 let mut __tmp = BytesMut::new(bytes);
17542 #[allow(clippy::absurd_extreme_comparisons)]
17543 #[allow(unused_comparisons)]
17544 if __tmp.remaining() < Self::ENCODED_LEN {
17545 panic!(
17546 "buffer is too small (need {} bytes, but got {})",
17547 Self::ENCODED_LEN,
17548 __tmp.remaining(),
17549 )
17550 }
17551 __tmp.put_u64_le(self.timestamp);
17552 __tmp.put_u32_le(self.tx_rate);
17553 __tmp.put_u32_le(self.rx_rate);
17554 __tmp.put_u32_le(self.messages_sent);
17555 __tmp.put_u32_le(self.messages_received);
17556 __tmp.put_u32_le(self.messages_lost);
17557 __tmp.put_u16_le(self.rx_parse_err);
17558 __tmp.put_u16_le(self.tx_overflows);
17559 __tmp.put_u16_le(self.rx_overflows);
17560 __tmp.put_u8(self.tx_buf);
17561 __tmp.put_u8(self.rx_buf);
17562 if matches!(version, MavlinkVersion::V2) {
17563 let len = __tmp.len();
17564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17565 } else {
17566 __tmp.len()
17567 }
17568 }
17569}
17570#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17571#[doc = ""]
17572#[doc = "ID: 32"]
17573#[derive(Debug, Clone, PartialEq)]
17574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17576#[cfg_attr(feature = "ts", derive(TS))]
17577#[cfg_attr(feature = "ts", ts(export))]
17578pub struct LOCAL_POSITION_NED_DATA {
17579 #[doc = "Timestamp (time since system boot)."]
17580 pub time_boot_ms: u32,
17581 #[doc = "X Position"]
17582 pub x: f32,
17583 #[doc = "Y Position"]
17584 pub y: f32,
17585 #[doc = "Z Position"]
17586 pub z: f32,
17587 #[doc = "X Speed"]
17588 pub vx: f32,
17589 #[doc = "Y Speed"]
17590 pub vy: f32,
17591 #[doc = "Z Speed"]
17592 pub vz: f32,
17593}
17594impl LOCAL_POSITION_NED_DATA {
17595 pub const ENCODED_LEN: usize = 28usize;
17596 pub const DEFAULT: Self = Self {
17597 time_boot_ms: 0_u32,
17598 x: 0.0_f32,
17599 y: 0.0_f32,
17600 z: 0.0_f32,
17601 vx: 0.0_f32,
17602 vy: 0.0_f32,
17603 vz: 0.0_f32,
17604 };
17605 #[cfg(feature = "arbitrary")]
17606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17607 use arbitrary::{Arbitrary, Unstructured};
17608 let mut buf = [0u8; 1024];
17609 rng.fill_bytes(&mut buf);
17610 let mut unstructured = Unstructured::new(&buf);
17611 Self::arbitrary(&mut unstructured).unwrap_or_default()
17612 }
17613}
17614impl Default for LOCAL_POSITION_NED_DATA {
17615 fn default() -> Self {
17616 Self::DEFAULT.clone()
17617 }
17618}
17619impl MessageData for LOCAL_POSITION_NED_DATA {
17620 type Message = MavMessage;
17621 const ID: u32 = 32u32;
17622 const NAME: &'static str = "LOCAL_POSITION_NED";
17623 const EXTRA_CRC: u8 = 185u8;
17624 const ENCODED_LEN: usize = 28usize;
17625 fn deser(
17626 _version: MavlinkVersion,
17627 __input: &[u8],
17628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17629 let avail_len = __input.len();
17630 let mut payload_buf = [0; Self::ENCODED_LEN];
17631 let mut buf = if avail_len < Self::ENCODED_LEN {
17632 payload_buf[0..avail_len].copy_from_slice(__input);
17633 Bytes::new(&payload_buf)
17634 } else {
17635 Bytes::new(__input)
17636 };
17637 let mut __struct = Self::default();
17638 __struct.time_boot_ms = buf.get_u32_le()?;
17639 __struct.x = buf.get_f32_le()?;
17640 __struct.y = buf.get_f32_le()?;
17641 __struct.z = buf.get_f32_le()?;
17642 __struct.vx = buf.get_f32_le()?;
17643 __struct.vy = buf.get_f32_le()?;
17644 __struct.vz = buf.get_f32_le()?;
17645 Ok(__struct)
17646 }
17647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17648 let mut __tmp = BytesMut::new(bytes);
17649 #[allow(clippy::absurd_extreme_comparisons)]
17650 #[allow(unused_comparisons)]
17651 if __tmp.remaining() < Self::ENCODED_LEN {
17652 panic!(
17653 "buffer is too small (need {} bytes, but got {})",
17654 Self::ENCODED_LEN,
17655 __tmp.remaining(),
17656 )
17657 }
17658 __tmp.put_u32_le(self.time_boot_ms);
17659 __tmp.put_f32_le(self.x);
17660 __tmp.put_f32_le(self.y);
17661 __tmp.put_f32_le(self.z);
17662 __tmp.put_f32_le(self.vx);
17663 __tmp.put_f32_le(self.vy);
17664 __tmp.put_f32_le(self.vz);
17665 if matches!(version, MavlinkVersion::V2) {
17666 let len = __tmp.len();
17667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17668 } else {
17669 __tmp.len()
17670 }
17671 }
17672}
17673#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17674#[doc = ""]
17675#[doc = "ID: 64"]
17676#[derive(Debug, Clone, PartialEq)]
17677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17679#[cfg_attr(feature = "ts", derive(TS))]
17680#[cfg_attr(feature = "ts", ts(export))]
17681pub struct LOCAL_POSITION_NED_COV_DATA {
17682 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17683 pub time_usec: u64,
17684 #[doc = "X Position"]
17685 pub x: f32,
17686 #[doc = "Y Position"]
17687 pub y: f32,
17688 #[doc = "Z Position"]
17689 pub z: f32,
17690 #[doc = "X Speed"]
17691 pub vx: f32,
17692 #[doc = "Y Speed"]
17693 pub vy: f32,
17694 #[doc = "Z Speed"]
17695 pub vz: f32,
17696 #[doc = "X Acceleration"]
17697 pub ax: f32,
17698 #[doc = "Y Acceleration"]
17699 pub ay: f32,
17700 #[doc = "Z Acceleration"]
17701 pub az: f32,
17702 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17704 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17705 pub covariance: [f32; 45],
17706 #[doc = "Class id of the estimator this estimate originated from."]
17707 pub estimator_type: MavEstimatorType,
17708}
17709impl LOCAL_POSITION_NED_COV_DATA {
17710 pub const ENCODED_LEN: usize = 225usize;
17711 pub const DEFAULT: Self = Self {
17712 time_usec: 0_u64,
17713 x: 0.0_f32,
17714 y: 0.0_f32,
17715 z: 0.0_f32,
17716 vx: 0.0_f32,
17717 vy: 0.0_f32,
17718 vz: 0.0_f32,
17719 ax: 0.0_f32,
17720 ay: 0.0_f32,
17721 az: 0.0_f32,
17722 covariance: [0.0_f32; 45usize],
17723 estimator_type: MavEstimatorType::DEFAULT,
17724 };
17725 #[cfg(feature = "arbitrary")]
17726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17727 use arbitrary::{Arbitrary, Unstructured};
17728 let mut buf = [0u8; 1024];
17729 rng.fill_bytes(&mut buf);
17730 let mut unstructured = Unstructured::new(&buf);
17731 Self::arbitrary(&mut unstructured).unwrap_or_default()
17732 }
17733}
17734impl Default for LOCAL_POSITION_NED_COV_DATA {
17735 fn default() -> Self {
17736 Self::DEFAULT.clone()
17737 }
17738}
17739impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17740 type Message = MavMessage;
17741 const ID: u32 = 64u32;
17742 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17743 const EXTRA_CRC: u8 = 191u8;
17744 const ENCODED_LEN: usize = 225usize;
17745 fn deser(
17746 _version: MavlinkVersion,
17747 __input: &[u8],
17748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17749 let avail_len = __input.len();
17750 let mut payload_buf = [0; Self::ENCODED_LEN];
17751 let mut buf = if avail_len < Self::ENCODED_LEN {
17752 payload_buf[0..avail_len].copy_from_slice(__input);
17753 Bytes::new(&payload_buf)
17754 } else {
17755 Bytes::new(__input)
17756 };
17757 let mut __struct = Self::default();
17758 __struct.time_usec = buf.get_u64_le()?;
17759 __struct.x = buf.get_f32_le()?;
17760 __struct.y = buf.get_f32_le()?;
17761 __struct.z = buf.get_f32_le()?;
17762 __struct.vx = buf.get_f32_le()?;
17763 __struct.vy = buf.get_f32_le()?;
17764 __struct.vz = buf.get_f32_le()?;
17765 __struct.ax = buf.get_f32_le()?;
17766 __struct.ay = buf.get_f32_le()?;
17767 __struct.az = buf.get_f32_le()?;
17768 for v in &mut __struct.covariance {
17769 let val = buf.get_f32_le()?;
17770 *v = val;
17771 }
17772 let tmp = buf.get_u8()?;
17773 __struct.estimator_type =
17774 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17775 enum_type: "MavEstimatorType",
17776 value: tmp as u64,
17777 })?;
17778 Ok(__struct)
17779 }
17780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17781 let mut __tmp = BytesMut::new(bytes);
17782 #[allow(clippy::absurd_extreme_comparisons)]
17783 #[allow(unused_comparisons)]
17784 if __tmp.remaining() < Self::ENCODED_LEN {
17785 panic!(
17786 "buffer is too small (need {} bytes, but got {})",
17787 Self::ENCODED_LEN,
17788 __tmp.remaining(),
17789 )
17790 }
17791 __tmp.put_u64_le(self.time_usec);
17792 __tmp.put_f32_le(self.x);
17793 __tmp.put_f32_le(self.y);
17794 __tmp.put_f32_le(self.z);
17795 __tmp.put_f32_le(self.vx);
17796 __tmp.put_f32_le(self.vy);
17797 __tmp.put_f32_le(self.vz);
17798 __tmp.put_f32_le(self.ax);
17799 __tmp.put_f32_le(self.ay);
17800 __tmp.put_f32_le(self.az);
17801 for val in &self.covariance {
17802 __tmp.put_f32_le(*val);
17803 }
17804 __tmp.put_u8(self.estimator_type as u8);
17805 if matches!(version, MavlinkVersion::V2) {
17806 let len = __tmp.len();
17807 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17808 } else {
17809 __tmp.len()
17810 }
17811 }
17812}
17813#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17814#[doc = ""]
17815#[doc = "ID: 89"]
17816#[derive(Debug, Clone, PartialEq)]
17817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17819#[cfg_attr(feature = "ts", derive(TS))]
17820#[cfg_attr(feature = "ts", ts(export))]
17821pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17822 #[doc = "Timestamp (time since system boot)."]
17823 pub time_boot_ms: u32,
17824 #[doc = "X Position"]
17825 pub x: f32,
17826 #[doc = "Y Position"]
17827 pub y: f32,
17828 #[doc = "Z Position"]
17829 pub z: f32,
17830 #[doc = "Roll"]
17831 pub roll: f32,
17832 #[doc = "Pitch"]
17833 pub pitch: f32,
17834 #[doc = "Yaw"]
17835 pub yaw: f32,
17836}
17837impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17838 pub const ENCODED_LEN: usize = 28usize;
17839 pub const DEFAULT: Self = Self {
17840 time_boot_ms: 0_u32,
17841 x: 0.0_f32,
17842 y: 0.0_f32,
17843 z: 0.0_f32,
17844 roll: 0.0_f32,
17845 pitch: 0.0_f32,
17846 yaw: 0.0_f32,
17847 };
17848 #[cfg(feature = "arbitrary")]
17849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17850 use arbitrary::{Arbitrary, Unstructured};
17851 let mut buf = [0u8; 1024];
17852 rng.fill_bytes(&mut buf);
17853 let mut unstructured = Unstructured::new(&buf);
17854 Self::arbitrary(&mut unstructured).unwrap_or_default()
17855 }
17856}
17857impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17858 fn default() -> Self {
17859 Self::DEFAULT.clone()
17860 }
17861}
17862impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17863 type Message = MavMessage;
17864 const ID: u32 = 89u32;
17865 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17866 const EXTRA_CRC: u8 = 231u8;
17867 const ENCODED_LEN: usize = 28usize;
17868 fn deser(
17869 _version: MavlinkVersion,
17870 __input: &[u8],
17871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17872 let avail_len = __input.len();
17873 let mut payload_buf = [0; Self::ENCODED_LEN];
17874 let mut buf = if avail_len < Self::ENCODED_LEN {
17875 payload_buf[0..avail_len].copy_from_slice(__input);
17876 Bytes::new(&payload_buf)
17877 } else {
17878 Bytes::new(__input)
17879 };
17880 let mut __struct = Self::default();
17881 __struct.time_boot_ms = buf.get_u32_le()?;
17882 __struct.x = buf.get_f32_le()?;
17883 __struct.y = buf.get_f32_le()?;
17884 __struct.z = buf.get_f32_le()?;
17885 __struct.roll = buf.get_f32_le()?;
17886 __struct.pitch = buf.get_f32_le()?;
17887 __struct.yaw = buf.get_f32_le()?;
17888 Ok(__struct)
17889 }
17890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17891 let mut __tmp = BytesMut::new(bytes);
17892 #[allow(clippy::absurd_extreme_comparisons)]
17893 #[allow(unused_comparisons)]
17894 if __tmp.remaining() < Self::ENCODED_LEN {
17895 panic!(
17896 "buffer is too small (need {} bytes, but got {})",
17897 Self::ENCODED_LEN,
17898 __tmp.remaining(),
17899 )
17900 }
17901 __tmp.put_u32_le(self.time_boot_ms);
17902 __tmp.put_f32_le(self.x);
17903 __tmp.put_f32_le(self.y);
17904 __tmp.put_f32_le(self.z);
17905 __tmp.put_f32_le(self.roll);
17906 __tmp.put_f32_le(self.pitch);
17907 __tmp.put_f32_le(self.yaw);
17908 if matches!(version, MavlinkVersion::V2) {
17909 let len = __tmp.len();
17910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17911 } else {
17912 __tmp.len()
17913 }
17914 }
17915}
17916#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17917#[doc = ""]
17918#[doc = "ID: 268"]
17919#[derive(Debug, Clone, PartialEq)]
17920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17922#[cfg_attr(feature = "ts", derive(TS))]
17923#[cfg_attr(feature = "ts", ts(export))]
17924pub struct LOGGING_ACK_DATA {
17925 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17926 pub sequence: u16,
17927 #[doc = "system ID of the target"]
17928 pub target_system: u8,
17929 #[doc = "component ID of the target"]
17930 pub target_component: u8,
17931}
17932impl LOGGING_ACK_DATA {
17933 pub const ENCODED_LEN: usize = 4usize;
17934 pub const DEFAULT: Self = Self {
17935 sequence: 0_u16,
17936 target_system: 0_u8,
17937 target_component: 0_u8,
17938 };
17939 #[cfg(feature = "arbitrary")]
17940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17941 use arbitrary::{Arbitrary, Unstructured};
17942 let mut buf = [0u8; 1024];
17943 rng.fill_bytes(&mut buf);
17944 let mut unstructured = Unstructured::new(&buf);
17945 Self::arbitrary(&mut unstructured).unwrap_or_default()
17946 }
17947}
17948impl Default for LOGGING_ACK_DATA {
17949 fn default() -> Self {
17950 Self::DEFAULT.clone()
17951 }
17952}
17953impl MessageData for LOGGING_ACK_DATA {
17954 type Message = MavMessage;
17955 const ID: u32 = 268u32;
17956 const NAME: &'static str = "LOGGING_ACK";
17957 const EXTRA_CRC: u8 = 14u8;
17958 const ENCODED_LEN: usize = 4usize;
17959 fn deser(
17960 _version: MavlinkVersion,
17961 __input: &[u8],
17962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17963 let avail_len = __input.len();
17964 let mut payload_buf = [0; Self::ENCODED_LEN];
17965 let mut buf = if avail_len < Self::ENCODED_LEN {
17966 payload_buf[0..avail_len].copy_from_slice(__input);
17967 Bytes::new(&payload_buf)
17968 } else {
17969 Bytes::new(__input)
17970 };
17971 let mut __struct = Self::default();
17972 __struct.sequence = buf.get_u16_le()?;
17973 __struct.target_system = buf.get_u8()?;
17974 __struct.target_component = buf.get_u8()?;
17975 Ok(__struct)
17976 }
17977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17978 let mut __tmp = BytesMut::new(bytes);
17979 #[allow(clippy::absurd_extreme_comparisons)]
17980 #[allow(unused_comparisons)]
17981 if __tmp.remaining() < Self::ENCODED_LEN {
17982 panic!(
17983 "buffer is too small (need {} bytes, but got {})",
17984 Self::ENCODED_LEN,
17985 __tmp.remaining(),
17986 )
17987 }
17988 __tmp.put_u16_le(self.sequence);
17989 __tmp.put_u8(self.target_system);
17990 __tmp.put_u8(self.target_component);
17991 if matches!(version, MavlinkVersion::V2) {
17992 let len = __tmp.len();
17993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17994 } else {
17995 __tmp.len()
17996 }
17997 }
17998}
17999#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18000#[doc = ""]
18001#[doc = "ID: 266"]
18002#[derive(Debug, Clone, PartialEq)]
18003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18005#[cfg_attr(feature = "ts", derive(TS))]
18006#[cfg_attr(feature = "ts", ts(export))]
18007pub struct LOGGING_DATA_DATA {
18008 #[doc = "sequence number (can wrap)"]
18009 pub sequence: u16,
18010 #[doc = "system ID of the target"]
18011 pub target_system: u8,
18012 #[doc = "component ID of the target"]
18013 pub target_component: u8,
18014 #[doc = "data length"]
18015 pub length: u8,
18016 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18017 pub first_message_offset: u8,
18018 #[doc = "logged data"]
18019 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18020 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18021 pub data: [u8; 249],
18022}
18023impl LOGGING_DATA_DATA {
18024 pub const ENCODED_LEN: usize = 255usize;
18025 pub const DEFAULT: Self = Self {
18026 sequence: 0_u16,
18027 target_system: 0_u8,
18028 target_component: 0_u8,
18029 length: 0_u8,
18030 first_message_offset: 0_u8,
18031 data: [0_u8; 249usize],
18032 };
18033 #[cfg(feature = "arbitrary")]
18034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18035 use arbitrary::{Arbitrary, Unstructured};
18036 let mut buf = [0u8; 1024];
18037 rng.fill_bytes(&mut buf);
18038 let mut unstructured = Unstructured::new(&buf);
18039 Self::arbitrary(&mut unstructured).unwrap_or_default()
18040 }
18041}
18042impl Default for LOGGING_DATA_DATA {
18043 fn default() -> Self {
18044 Self::DEFAULT.clone()
18045 }
18046}
18047impl MessageData for LOGGING_DATA_DATA {
18048 type Message = MavMessage;
18049 const ID: u32 = 266u32;
18050 const NAME: &'static str = "LOGGING_DATA";
18051 const EXTRA_CRC: u8 = 193u8;
18052 const ENCODED_LEN: usize = 255usize;
18053 fn deser(
18054 _version: MavlinkVersion,
18055 __input: &[u8],
18056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18057 let avail_len = __input.len();
18058 let mut payload_buf = [0; Self::ENCODED_LEN];
18059 let mut buf = if avail_len < Self::ENCODED_LEN {
18060 payload_buf[0..avail_len].copy_from_slice(__input);
18061 Bytes::new(&payload_buf)
18062 } else {
18063 Bytes::new(__input)
18064 };
18065 let mut __struct = Self::default();
18066 __struct.sequence = buf.get_u16_le()?;
18067 __struct.target_system = buf.get_u8()?;
18068 __struct.target_component = buf.get_u8()?;
18069 __struct.length = buf.get_u8()?;
18070 __struct.first_message_offset = buf.get_u8()?;
18071 for v in &mut __struct.data {
18072 let val = buf.get_u8()?;
18073 *v = val;
18074 }
18075 Ok(__struct)
18076 }
18077 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18078 let mut __tmp = BytesMut::new(bytes);
18079 #[allow(clippy::absurd_extreme_comparisons)]
18080 #[allow(unused_comparisons)]
18081 if __tmp.remaining() < Self::ENCODED_LEN {
18082 panic!(
18083 "buffer is too small (need {} bytes, but got {})",
18084 Self::ENCODED_LEN,
18085 __tmp.remaining(),
18086 )
18087 }
18088 __tmp.put_u16_le(self.sequence);
18089 __tmp.put_u8(self.target_system);
18090 __tmp.put_u8(self.target_component);
18091 __tmp.put_u8(self.length);
18092 __tmp.put_u8(self.first_message_offset);
18093 for val in &self.data {
18094 __tmp.put_u8(*val);
18095 }
18096 if matches!(version, MavlinkVersion::V2) {
18097 let len = __tmp.len();
18098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18099 } else {
18100 __tmp.len()
18101 }
18102 }
18103}
18104#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18105#[doc = ""]
18106#[doc = "ID: 267"]
18107#[derive(Debug, Clone, PartialEq)]
18108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18110#[cfg_attr(feature = "ts", derive(TS))]
18111#[cfg_attr(feature = "ts", ts(export))]
18112pub struct LOGGING_DATA_ACKED_DATA {
18113 #[doc = "sequence number (can wrap)"]
18114 pub sequence: u16,
18115 #[doc = "system ID of the target"]
18116 pub target_system: u8,
18117 #[doc = "component ID of the target"]
18118 pub target_component: u8,
18119 #[doc = "data length"]
18120 pub length: u8,
18121 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18122 pub first_message_offset: u8,
18123 #[doc = "logged data"]
18124 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18125 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18126 pub data: [u8; 249],
18127}
18128impl LOGGING_DATA_ACKED_DATA {
18129 pub const ENCODED_LEN: usize = 255usize;
18130 pub const DEFAULT: Self = Self {
18131 sequence: 0_u16,
18132 target_system: 0_u8,
18133 target_component: 0_u8,
18134 length: 0_u8,
18135 first_message_offset: 0_u8,
18136 data: [0_u8; 249usize],
18137 };
18138 #[cfg(feature = "arbitrary")]
18139 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18140 use arbitrary::{Arbitrary, Unstructured};
18141 let mut buf = [0u8; 1024];
18142 rng.fill_bytes(&mut buf);
18143 let mut unstructured = Unstructured::new(&buf);
18144 Self::arbitrary(&mut unstructured).unwrap_or_default()
18145 }
18146}
18147impl Default for LOGGING_DATA_ACKED_DATA {
18148 fn default() -> Self {
18149 Self::DEFAULT.clone()
18150 }
18151}
18152impl MessageData for LOGGING_DATA_ACKED_DATA {
18153 type Message = MavMessage;
18154 const ID: u32 = 267u32;
18155 const NAME: &'static str = "LOGGING_DATA_ACKED";
18156 const EXTRA_CRC: u8 = 35u8;
18157 const ENCODED_LEN: usize = 255usize;
18158 fn deser(
18159 _version: MavlinkVersion,
18160 __input: &[u8],
18161 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18162 let avail_len = __input.len();
18163 let mut payload_buf = [0; Self::ENCODED_LEN];
18164 let mut buf = if avail_len < Self::ENCODED_LEN {
18165 payload_buf[0..avail_len].copy_from_slice(__input);
18166 Bytes::new(&payload_buf)
18167 } else {
18168 Bytes::new(__input)
18169 };
18170 let mut __struct = Self::default();
18171 __struct.sequence = buf.get_u16_le()?;
18172 __struct.target_system = buf.get_u8()?;
18173 __struct.target_component = buf.get_u8()?;
18174 __struct.length = buf.get_u8()?;
18175 __struct.first_message_offset = buf.get_u8()?;
18176 for v in &mut __struct.data {
18177 let val = buf.get_u8()?;
18178 *v = val;
18179 }
18180 Ok(__struct)
18181 }
18182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18183 let mut __tmp = BytesMut::new(bytes);
18184 #[allow(clippy::absurd_extreme_comparisons)]
18185 #[allow(unused_comparisons)]
18186 if __tmp.remaining() < Self::ENCODED_LEN {
18187 panic!(
18188 "buffer is too small (need {} bytes, but got {})",
18189 Self::ENCODED_LEN,
18190 __tmp.remaining(),
18191 )
18192 }
18193 __tmp.put_u16_le(self.sequence);
18194 __tmp.put_u8(self.target_system);
18195 __tmp.put_u8(self.target_component);
18196 __tmp.put_u8(self.length);
18197 __tmp.put_u8(self.first_message_offset);
18198 for val in &self.data {
18199 __tmp.put_u8(*val);
18200 }
18201 if matches!(version, MavlinkVersion::V2) {
18202 let len = __tmp.len();
18203 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18204 } else {
18205 __tmp.len()
18206 }
18207 }
18208}
18209#[doc = "Reply to LOG_REQUEST_DATA."]
18210#[doc = ""]
18211#[doc = "ID: 120"]
18212#[derive(Debug, Clone, PartialEq)]
18213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18214#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18215#[cfg_attr(feature = "ts", derive(TS))]
18216#[cfg_attr(feature = "ts", ts(export))]
18217pub struct LOG_DATA_DATA {
18218 #[doc = "Offset into the log"]
18219 pub ofs: u32,
18220 #[doc = "Log id (from LOG_ENTRY reply)"]
18221 pub id: u16,
18222 #[doc = "Number of bytes (zero for end of log)"]
18223 pub count: u8,
18224 #[doc = "log data"]
18225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18226 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18227 pub data: [u8; 90],
18228}
18229impl LOG_DATA_DATA {
18230 pub const ENCODED_LEN: usize = 97usize;
18231 pub const DEFAULT: Self = Self {
18232 ofs: 0_u32,
18233 id: 0_u16,
18234 count: 0_u8,
18235 data: [0_u8; 90usize],
18236 };
18237 #[cfg(feature = "arbitrary")]
18238 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18239 use arbitrary::{Arbitrary, Unstructured};
18240 let mut buf = [0u8; 1024];
18241 rng.fill_bytes(&mut buf);
18242 let mut unstructured = Unstructured::new(&buf);
18243 Self::arbitrary(&mut unstructured).unwrap_or_default()
18244 }
18245}
18246impl Default for LOG_DATA_DATA {
18247 fn default() -> Self {
18248 Self::DEFAULT.clone()
18249 }
18250}
18251impl MessageData for LOG_DATA_DATA {
18252 type Message = MavMessage;
18253 const ID: u32 = 120u32;
18254 const NAME: &'static str = "LOG_DATA";
18255 const EXTRA_CRC: u8 = 134u8;
18256 const ENCODED_LEN: usize = 97usize;
18257 fn deser(
18258 _version: MavlinkVersion,
18259 __input: &[u8],
18260 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18261 let avail_len = __input.len();
18262 let mut payload_buf = [0; Self::ENCODED_LEN];
18263 let mut buf = if avail_len < Self::ENCODED_LEN {
18264 payload_buf[0..avail_len].copy_from_slice(__input);
18265 Bytes::new(&payload_buf)
18266 } else {
18267 Bytes::new(__input)
18268 };
18269 let mut __struct = Self::default();
18270 __struct.ofs = buf.get_u32_le()?;
18271 __struct.id = buf.get_u16_le()?;
18272 __struct.count = buf.get_u8()?;
18273 for v in &mut __struct.data {
18274 let val = buf.get_u8()?;
18275 *v = val;
18276 }
18277 Ok(__struct)
18278 }
18279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18280 let mut __tmp = BytesMut::new(bytes);
18281 #[allow(clippy::absurd_extreme_comparisons)]
18282 #[allow(unused_comparisons)]
18283 if __tmp.remaining() < Self::ENCODED_LEN {
18284 panic!(
18285 "buffer is too small (need {} bytes, but got {})",
18286 Self::ENCODED_LEN,
18287 __tmp.remaining(),
18288 )
18289 }
18290 __tmp.put_u32_le(self.ofs);
18291 __tmp.put_u16_le(self.id);
18292 __tmp.put_u8(self.count);
18293 for val in &self.data {
18294 __tmp.put_u8(*val);
18295 }
18296 if matches!(version, MavlinkVersion::V2) {
18297 let len = __tmp.len();
18298 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18299 } else {
18300 __tmp.len()
18301 }
18302 }
18303}
18304#[doc = "Reply to LOG_REQUEST_LIST."]
18305#[doc = ""]
18306#[doc = "ID: 118"]
18307#[derive(Debug, Clone, PartialEq)]
18308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18310#[cfg_attr(feature = "ts", derive(TS))]
18311#[cfg_attr(feature = "ts", ts(export))]
18312pub struct LOG_ENTRY_DATA {
18313 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18314 pub time_utc: u32,
18315 #[doc = "Size of the log (may be approximate)"]
18316 pub size: u32,
18317 #[doc = "Log id"]
18318 pub id: u16,
18319 #[doc = "Total number of logs"]
18320 pub num_logs: u16,
18321 #[doc = "High log number"]
18322 pub last_log_num: u16,
18323}
18324impl LOG_ENTRY_DATA {
18325 pub const ENCODED_LEN: usize = 14usize;
18326 pub const DEFAULT: Self = Self {
18327 time_utc: 0_u32,
18328 size: 0_u32,
18329 id: 0_u16,
18330 num_logs: 0_u16,
18331 last_log_num: 0_u16,
18332 };
18333 #[cfg(feature = "arbitrary")]
18334 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18335 use arbitrary::{Arbitrary, Unstructured};
18336 let mut buf = [0u8; 1024];
18337 rng.fill_bytes(&mut buf);
18338 let mut unstructured = Unstructured::new(&buf);
18339 Self::arbitrary(&mut unstructured).unwrap_or_default()
18340 }
18341}
18342impl Default for LOG_ENTRY_DATA {
18343 fn default() -> Self {
18344 Self::DEFAULT.clone()
18345 }
18346}
18347impl MessageData for LOG_ENTRY_DATA {
18348 type Message = MavMessage;
18349 const ID: u32 = 118u32;
18350 const NAME: &'static str = "LOG_ENTRY";
18351 const EXTRA_CRC: u8 = 56u8;
18352 const ENCODED_LEN: usize = 14usize;
18353 fn deser(
18354 _version: MavlinkVersion,
18355 __input: &[u8],
18356 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18357 let avail_len = __input.len();
18358 let mut payload_buf = [0; Self::ENCODED_LEN];
18359 let mut buf = if avail_len < Self::ENCODED_LEN {
18360 payload_buf[0..avail_len].copy_from_slice(__input);
18361 Bytes::new(&payload_buf)
18362 } else {
18363 Bytes::new(__input)
18364 };
18365 let mut __struct = Self::default();
18366 __struct.time_utc = buf.get_u32_le()?;
18367 __struct.size = buf.get_u32_le()?;
18368 __struct.id = buf.get_u16_le()?;
18369 __struct.num_logs = buf.get_u16_le()?;
18370 __struct.last_log_num = buf.get_u16_le()?;
18371 Ok(__struct)
18372 }
18373 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18374 let mut __tmp = BytesMut::new(bytes);
18375 #[allow(clippy::absurd_extreme_comparisons)]
18376 #[allow(unused_comparisons)]
18377 if __tmp.remaining() < Self::ENCODED_LEN {
18378 panic!(
18379 "buffer is too small (need {} bytes, but got {})",
18380 Self::ENCODED_LEN,
18381 __tmp.remaining(),
18382 )
18383 }
18384 __tmp.put_u32_le(self.time_utc);
18385 __tmp.put_u32_le(self.size);
18386 __tmp.put_u16_le(self.id);
18387 __tmp.put_u16_le(self.num_logs);
18388 __tmp.put_u16_le(self.last_log_num);
18389 if matches!(version, MavlinkVersion::V2) {
18390 let len = __tmp.len();
18391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18392 } else {
18393 __tmp.len()
18394 }
18395 }
18396}
18397#[doc = "Erase all logs."]
18398#[doc = ""]
18399#[doc = "ID: 121"]
18400#[derive(Debug, Clone, PartialEq)]
18401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18403#[cfg_attr(feature = "ts", derive(TS))]
18404#[cfg_attr(feature = "ts", ts(export))]
18405pub struct LOG_ERASE_DATA {
18406 #[doc = "System ID"]
18407 pub target_system: u8,
18408 #[doc = "Component ID"]
18409 pub target_component: u8,
18410}
18411impl LOG_ERASE_DATA {
18412 pub const ENCODED_LEN: usize = 2usize;
18413 pub const DEFAULT: Self = Self {
18414 target_system: 0_u8,
18415 target_component: 0_u8,
18416 };
18417 #[cfg(feature = "arbitrary")]
18418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18419 use arbitrary::{Arbitrary, Unstructured};
18420 let mut buf = [0u8; 1024];
18421 rng.fill_bytes(&mut buf);
18422 let mut unstructured = Unstructured::new(&buf);
18423 Self::arbitrary(&mut unstructured).unwrap_or_default()
18424 }
18425}
18426impl Default for LOG_ERASE_DATA {
18427 fn default() -> Self {
18428 Self::DEFAULT.clone()
18429 }
18430}
18431impl MessageData for LOG_ERASE_DATA {
18432 type Message = MavMessage;
18433 const ID: u32 = 121u32;
18434 const NAME: &'static str = "LOG_ERASE";
18435 const EXTRA_CRC: u8 = 237u8;
18436 const ENCODED_LEN: usize = 2usize;
18437 fn deser(
18438 _version: MavlinkVersion,
18439 __input: &[u8],
18440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18441 let avail_len = __input.len();
18442 let mut payload_buf = [0; Self::ENCODED_LEN];
18443 let mut buf = if avail_len < Self::ENCODED_LEN {
18444 payload_buf[0..avail_len].copy_from_slice(__input);
18445 Bytes::new(&payload_buf)
18446 } else {
18447 Bytes::new(__input)
18448 };
18449 let mut __struct = Self::default();
18450 __struct.target_system = buf.get_u8()?;
18451 __struct.target_component = buf.get_u8()?;
18452 Ok(__struct)
18453 }
18454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18455 let mut __tmp = BytesMut::new(bytes);
18456 #[allow(clippy::absurd_extreme_comparisons)]
18457 #[allow(unused_comparisons)]
18458 if __tmp.remaining() < Self::ENCODED_LEN {
18459 panic!(
18460 "buffer is too small (need {} bytes, but got {})",
18461 Self::ENCODED_LEN,
18462 __tmp.remaining(),
18463 )
18464 }
18465 __tmp.put_u8(self.target_system);
18466 __tmp.put_u8(self.target_component);
18467 if matches!(version, MavlinkVersion::V2) {
18468 let len = __tmp.len();
18469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18470 } else {
18471 __tmp.len()
18472 }
18473 }
18474}
18475#[doc = "Request a chunk of a log."]
18476#[doc = ""]
18477#[doc = "ID: 119"]
18478#[derive(Debug, Clone, PartialEq)]
18479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18481#[cfg_attr(feature = "ts", derive(TS))]
18482#[cfg_attr(feature = "ts", ts(export))]
18483pub struct LOG_REQUEST_DATA_DATA {
18484 #[doc = "Offset into the log"]
18485 pub ofs: u32,
18486 #[doc = "Number of bytes"]
18487 pub count: u32,
18488 #[doc = "Log id (from LOG_ENTRY reply)"]
18489 pub id: u16,
18490 #[doc = "System ID"]
18491 pub target_system: u8,
18492 #[doc = "Component ID"]
18493 pub target_component: u8,
18494}
18495impl LOG_REQUEST_DATA_DATA {
18496 pub const ENCODED_LEN: usize = 12usize;
18497 pub const DEFAULT: Self = Self {
18498 ofs: 0_u32,
18499 count: 0_u32,
18500 id: 0_u16,
18501 target_system: 0_u8,
18502 target_component: 0_u8,
18503 };
18504 #[cfg(feature = "arbitrary")]
18505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18506 use arbitrary::{Arbitrary, Unstructured};
18507 let mut buf = [0u8; 1024];
18508 rng.fill_bytes(&mut buf);
18509 let mut unstructured = Unstructured::new(&buf);
18510 Self::arbitrary(&mut unstructured).unwrap_or_default()
18511 }
18512}
18513impl Default for LOG_REQUEST_DATA_DATA {
18514 fn default() -> Self {
18515 Self::DEFAULT.clone()
18516 }
18517}
18518impl MessageData for LOG_REQUEST_DATA_DATA {
18519 type Message = MavMessage;
18520 const ID: u32 = 119u32;
18521 const NAME: &'static str = "LOG_REQUEST_DATA";
18522 const EXTRA_CRC: u8 = 116u8;
18523 const ENCODED_LEN: usize = 12usize;
18524 fn deser(
18525 _version: MavlinkVersion,
18526 __input: &[u8],
18527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18528 let avail_len = __input.len();
18529 let mut payload_buf = [0; Self::ENCODED_LEN];
18530 let mut buf = if avail_len < Self::ENCODED_LEN {
18531 payload_buf[0..avail_len].copy_from_slice(__input);
18532 Bytes::new(&payload_buf)
18533 } else {
18534 Bytes::new(__input)
18535 };
18536 let mut __struct = Self::default();
18537 __struct.ofs = buf.get_u32_le()?;
18538 __struct.count = buf.get_u32_le()?;
18539 __struct.id = buf.get_u16_le()?;
18540 __struct.target_system = buf.get_u8()?;
18541 __struct.target_component = buf.get_u8()?;
18542 Ok(__struct)
18543 }
18544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18545 let mut __tmp = BytesMut::new(bytes);
18546 #[allow(clippy::absurd_extreme_comparisons)]
18547 #[allow(unused_comparisons)]
18548 if __tmp.remaining() < Self::ENCODED_LEN {
18549 panic!(
18550 "buffer is too small (need {} bytes, but got {})",
18551 Self::ENCODED_LEN,
18552 __tmp.remaining(),
18553 )
18554 }
18555 __tmp.put_u32_le(self.ofs);
18556 __tmp.put_u32_le(self.count);
18557 __tmp.put_u16_le(self.id);
18558 __tmp.put_u8(self.target_system);
18559 __tmp.put_u8(self.target_component);
18560 if matches!(version, MavlinkVersion::V2) {
18561 let len = __tmp.len();
18562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18563 } else {
18564 __tmp.len()
18565 }
18566 }
18567}
18568#[doc = "Stop log transfer and resume normal logging."]
18569#[doc = ""]
18570#[doc = "ID: 122"]
18571#[derive(Debug, Clone, PartialEq)]
18572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18574#[cfg_attr(feature = "ts", derive(TS))]
18575#[cfg_attr(feature = "ts", ts(export))]
18576pub struct LOG_REQUEST_END_DATA {
18577 #[doc = "System ID"]
18578 pub target_system: u8,
18579 #[doc = "Component ID"]
18580 pub target_component: u8,
18581}
18582impl LOG_REQUEST_END_DATA {
18583 pub const ENCODED_LEN: usize = 2usize;
18584 pub const DEFAULT: Self = Self {
18585 target_system: 0_u8,
18586 target_component: 0_u8,
18587 };
18588 #[cfg(feature = "arbitrary")]
18589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18590 use arbitrary::{Arbitrary, Unstructured};
18591 let mut buf = [0u8; 1024];
18592 rng.fill_bytes(&mut buf);
18593 let mut unstructured = Unstructured::new(&buf);
18594 Self::arbitrary(&mut unstructured).unwrap_or_default()
18595 }
18596}
18597impl Default for LOG_REQUEST_END_DATA {
18598 fn default() -> Self {
18599 Self::DEFAULT.clone()
18600 }
18601}
18602impl MessageData for LOG_REQUEST_END_DATA {
18603 type Message = MavMessage;
18604 const ID: u32 = 122u32;
18605 const NAME: &'static str = "LOG_REQUEST_END";
18606 const EXTRA_CRC: u8 = 203u8;
18607 const ENCODED_LEN: usize = 2usize;
18608 fn deser(
18609 _version: MavlinkVersion,
18610 __input: &[u8],
18611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18612 let avail_len = __input.len();
18613 let mut payload_buf = [0; Self::ENCODED_LEN];
18614 let mut buf = if avail_len < Self::ENCODED_LEN {
18615 payload_buf[0..avail_len].copy_from_slice(__input);
18616 Bytes::new(&payload_buf)
18617 } else {
18618 Bytes::new(__input)
18619 };
18620 let mut __struct = Self::default();
18621 __struct.target_system = buf.get_u8()?;
18622 __struct.target_component = buf.get_u8()?;
18623 Ok(__struct)
18624 }
18625 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18626 let mut __tmp = BytesMut::new(bytes);
18627 #[allow(clippy::absurd_extreme_comparisons)]
18628 #[allow(unused_comparisons)]
18629 if __tmp.remaining() < Self::ENCODED_LEN {
18630 panic!(
18631 "buffer is too small (need {} bytes, but got {})",
18632 Self::ENCODED_LEN,
18633 __tmp.remaining(),
18634 )
18635 }
18636 __tmp.put_u8(self.target_system);
18637 __tmp.put_u8(self.target_component);
18638 if matches!(version, MavlinkVersion::V2) {
18639 let len = __tmp.len();
18640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18641 } else {
18642 __tmp.len()
18643 }
18644 }
18645}
18646#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18647#[doc = ""]
18648#[doc = "ID: 117"]
18649#[derive(Debug, Clone, PartialEq)]
18650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18652#[cfg_attr(feature = "ts", derive(TS))]
18653#[cfg_attr(feature = "ts", ts(export))]
18654pub struct LOG_REQUEST_LIST_DATA {
18655 #[doc = "First log id (0 for first available)"]
18656 pub start: u16,
18657 #[doc = "Last log id (0xffff for last available)"]
18658 pub end: u16,
18659 #[doc = "System ID"]
18660 pub target_system: u8,
18661 #[doc = "Component ID"]
18662 pub target_component: u8,
18663}
18664impl LOG_REQUEST_LIST_DATA {
18665 pub const ENCODED_LEN: usize = 6usize;
18666 pub const DEFAULT: Self = Self {
18667 start: 0_u16,
18668 end: 0_u16,
18669 target_system: 0_u8,
18670 target_component: 0_u8,
18671 };
18672 #[cfg(feature = "arbitrary")]
18673 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18674 use arbitrary::{Arbitrary, Unstructured};
18675 let mut buf = [0u8; 1024];
18676 rng.fill_bytes(&mut buf);
18677 let mut unstructured = Unstructured::new(&buf);
18678 Self::arbitrary(&mut unstructured).unwrap_or_default()
18679 }
18680}
18681impl Default for LOG_REQUEST_LIST_DATA {
18682 fn default() -> Self {
18683 Self::DEFAULT.clone()
18684 }
18685}
18686impl MessageData for LOG_REQUEST_LIST_DATA {
18687 type Message = MavMessage;
18688 const ID: u32 = 117u32;
18689 const NAME: &'static str = "LOG_REQUEST_LIST";
18690 const EXTRA_CRC: u8 = 128u8;
18691 const ENCODED_LEN: usize = 6usize;
18692 fn deser(
18693 _version: MavlinkVersion,
18694 __input: &[u8],
18695 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18696 let avail_len = __input.len();
18697 let mut payload_buf = [0; Self::ENCODED_LEN];
18698 let mut buf = if avail_len < Self::ENCODED_LEN {
18699 payload_buf[0..avail_len].copy_from_slice(__input);
18700 Bytes::new(&payload_buf)
18701 } else {
18702 Bytes::new(__input)
18703 };
18704 let mut __struct = Self::default();
18705 __struct.start = buf.get_u16_le()?;
18706 __struct.end = buf.get_u16_le()?;
18707 __struct.target_system = buf.get_u8()?;
18708 __struct.target_component = buf.get_u8()?;
18709 Ok(__struct)
18710 }
18711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18712 let mut __tmp = BytesMut::new(bytes);
18713 #[allow(clippy::absurd_extreme_comparisons)]
18714 #[allow(unused_comparisons)]
18715 if __tmp.remaining() < Self::ENCODED_LEN {
18716 panic!(
18717 "buffer is too small (need {} bytes, but got {})",
18718 Self::ENCODED_LEN,
18719 __tmp.remaining(),
18720 )
18721 }
18722 __tmp.put_u16_le(self.start);
18723 __tmp.put_u16_le(self.end);
18724 __tmp.put_u8(self.target_system);
18725 __tmp.put_u8(self.target_component);
18726 if matches!(version, MavlinkVersion::V2) {
18727 let len = __tmp.len();
18728 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18729 } else {
18730 __tmp.len()
18731 }
18732 }
18733}
18734#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18735#[doc = ""]
18736#[doc = "ID: 192"]
18737#[derive(Debug, Clone, PartialEq)]
18738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18740#[cfg_attr(feature = "ts", derive(TS))]
18741#[cfg_attr(feature = "ts", ts(export))]
18742pub struct MAG_CAL_REPORT_DATA {
18743 #[doc = "RMS milligauss residuals."]
18744 pub fitness: f32,
18745 #[doc = "X offset."]
18746 pub ofs_x: f32,
18747 #[doc = "Y offset."]
18748 pub ofs_y: f32,
18749 #[doc = "Z offset."]
18750 pub ofs_z: f32,
18751 #[doc = "X diagonal (matrix 11)."]
18752 pub diag_x: f32,
18753 #[doc = "Y diagonal (matrix 22)."]
18754 pub diag_y: f32,
18755 #[doc = "Z diagonal (matrix 33)."]
18756 pub diag_z: f32,
18757 #[doc = "X off-diagonal (matrix 12 and 21)."]
18758 pub offdiag_x: f32,
18759 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18760 pub offdiag_y: f32,
18761 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18762 pub offdiag_z: f32,
18763 #[doc = "Compass being calibrated."]
18764 pub compass_id: u8,
18765 #[doc = "Bitmask of compasses being calibrated."]
18766 pub cal_mask: u8,
18767 #[doc = "Calibration Status."]
18768 pub cal_status: MagCalStatus,
18769 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18770 pub autosaved: u8,
18771 #[doc = "Confidence in orientation (higher is better)."]
18772 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18773 pub orientation_confidence: f32,
18774 #[doc = "orientation before calibration."]
18775 #[cfg_attr(feature = "serde", serde(default))]
18776 pub old_orientation: MavSensorOrientation,
18777 #[doc = "orientation after calibration."]
18778 #[cfg_attr(feature = "serde", serde(default))]
18779 pub new_orientation: MavSensorOrientation,
18780 #[doc = "field radius correction factor"]
18781 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18782 pub scale_factor: f32,
18783}
18784impl MAG_CAL_REPORT_DATA {
18785 pub const ENCODED_LEN: usize = 54usize;
18786 pub const DEFAULT: Self = Self {
18787 fitness: 0.0_f32,
18788 ofs_x: 0.0_f32,
18789 ofs_y: 0.0_f32,
18790 ofs_z: 0.0_f32,
18791 diag_x: 0.0_f32,
18792 diag_y: 0.0_f32,
18793 diag_z: 0.0_f32,
18794 offdiag_x: 0.0_f32,
18795 offdiag_y: 0.0_f32,
18796 offdiag_z: 0.0_f32,
18797 compass_id: 0_u8,
18798 cal_mask: 0_u8,
18799 cal_status: MagCalStatus::DEFAULT,
18800 autosaved: 0_u8,
18801 orientation_confidence: 0.0_f32,
18802 old_orientation: MavSensorOrientation::DEFAULT,
18803 new_orientation: MavSensorOrientation::DEFAULT,
18804 scale_factor: 0.0_f32,
18805 };
18806 #[cfg(feature = "arbitrary")]
18807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18808 use arbitrary::{Arbitrary, Unstructured};
18809 let mut buf = [0u8; 1024];
18810 rng.fill_bytes(&mut buf);
18811 let mut unstructured = Unstructured::new(&buf);
18812 Self::arbitrary(&mut unstructured).unwrap_or_default()
18813 }
18814}
18815impl Default for MAG_CAL_REPORT_DATA {
18816 fn default() -> Self {
18817 Self::DEFAULT.clone()
18818 }
18819}
18820impl MessageData for MAG_CAL_REPORT_DATA {
18821 type Message = MavMessage;
18822 const ID: u32 = 192u32;
18823 const NAME: &'static str = "MAG_CAL_REPORT";
18824 const EXTRA_CRC: u8 = 36u8;
18825 const ENCODED_LEN: usize = 54usize;
18826 fn deser(
18827 _version: MavlinkVersion,
18828 __input: &[u8],
18829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18830 let avail_len = __input.len();
18831 let mut payload_buf = [0; Self::ENCODED_LEN];
18832 let mut buf = if avail_len < Self::ENCODED_LEN {
18833 payload_buf[0..avail_len].copy_from_slice(__input);
18834 Bytes::new(&payload_buf)
18835 } else {
18836 Bytes::new(__input)
18837 };
18838 let mut __struct = Self::default();
18839 __struct.fitness = buf.get_f32_le()?;
18840 __struct.ofs_x = buf.get_f32_le()?;
18841 __struct.ofs_y = buf.get_f32_le()?;
18842 __struct.ofs_z = buf.get_f32_le()?;
18843 __struct.diag_x = buf.get_f32_le()?;
18844 __struct.diag_y = buf.get_f32_le()?;
18845 __struct.diag_z = buf.get_f32_le()?;
18846 __struct.offdiag_x = buf.get_f32_le()?;
18847 __struct.offdiag_y = buf.get_f32_le()?;
18848 __struct.offdiag_z = buf.get_f32_le()?;
18849 __struct.compass_id = buf.get_u8()?;
18850 __struct.cal_mask = buf.get_u8()?;
18851 let tmp = buf.get_u8()?;
18852 __struct.cal_status =
18853 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18854 enum_type: "MagCalStatus",
18855 value: tmp as u64,
18856 })?;
18857 __struct.autosaved = buf.get_u8()?;
18858 __struct.orientation_confidence = buf.get_f32_le()?;
18859 let tmp = buf.get_u8()?;
18860 __struct.old_orientation =
18861 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18862 enum_type: "MavSensorOrientation",
18863 value: tmp as u64,
18864 })?;
18865 let tmp = buf.get_u8()?;
18866 __struct.new_orientation =
18867 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18868 enum_type: "MavSensorOrientation",
18869 value: tmp as u64,
18870 })?;
18871 __struct.scale_factor = buf.get_f32_le()?;
18872 Ok(__struct)
18873 }
18874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18875 let mut __tmp = BytesMut::new(bytes);
18876 #[allow(clippy::absurd_extreme_comparisons)]
18877 #[allow(unused_comparisons)]
18878 if __tmp.remaining() < Self::ENCODED_LEN {
18879 panic!(
18880 "buffer is too small (need {} bytes, but got {})",
18881 Self::ENCODED_LEN,
18882 __tmp.remaining(),
18883 )
18884 }
18885 __tmp.put_f32_le(self.fitness);
18886 __tmp.put_f32_le(self.ofs_x);
18887 __tmp.put_f32_le(self.ofs_y);
18888 __tmp.put_f32_le(self.ofs_z);
18889 __tmp.put_f32_le(self.diag_x);
18890 __tmp.put_f32_le(self.diag_y);
18891 __tmp.put_f32_le(self.diag_z);
18892 __tmp.put_f32_le(self.offdiag_x);
18893 __tmp.put_f32_le(self.offdiag_y);
18894 __tmp.put_f32_le(self.offdiag_z);
18895 __tmp.put_u8(self.compass_id);
18896 __tmp.put_u8(self.cal_mask);
18897 __tmp.put_u8(self.cal_status as u8);
18898 __tmp.put_u8(self.autosaved);
18899 if matches!(version, MavlinkVersion::V2) {
18900 __tmp.put_f32_le(self.orientation_confidence);
18901 __tmp.put_u8(self.old_orientation as u8);
18902 __tmp.put_u8(self.new_orientation as u8);
18903 __tmp.put_f32_le(self.scale_factor);
18904 let len = __tmp.len();
18905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18906 } else {
18907 __tmp.len()
18908 }
18909 }
18910}
18911#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18912#[doc = ""]
18913#[doc = "ID: 69"]
18914#[derive(Debug, Clone, PartialEq)]
18915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18917#[cfg_attr(feature = "ts", derive(TS))]
18918#[cfg_attr(feature = "ts", ts(export))]
18919pub struct MANUAL_CONTROL_DATA {
18920 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18921 pub x: i16,
18922 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18923 pub y: i16,
18924 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18925 pub z: i16,
18926 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18927 pub r: i16,
18928 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18929 pub buttons: u16,
18930 #[doc = "The system to be controlled."]
18931 pub target: u8,
18932 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18933 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18934 pub buttons2: u16,
18935 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18936 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18937 pub enabled_extensions: u8,
18938 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18939 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18940 pub s: i16,
18941 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18942 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18943 pub t: i16,
18944 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18945 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18946 pub aux1: i16,
18947 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18948 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18949 pub aux2: i16,
18950 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18952 pub aux3: i16,
18953 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18954 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18955 pub aux4: i16,
18956 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18957 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18958 pub aux5: i16,
18959 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18961 pub aux6: i16,
18962}
18963impl MANUAL_CONTROL_DATA {
18964 pub const ENCODED_LEN: usize = 30usize;
18965 pub const DEFAULT: Self = Self {
18966 x: 0_i16,
18967 y: 0_i16,
18968 z: 0_i16,
18969 r: 0_i16,
18970 buttons: 0_u16,
18971 target: 0_u8,
18972 buttons2: 0_u16,
18973 enabled_extensions: 0_u8,
18974 s: 0_i16,
18975 t: 0_i16,
18976 aux1: 0_i16,
18977 aux2: 0_i16,
18978 aux3: 0_i16,
18979 aux4: 0_i16,
18980 aux5: 0_i16,
18981 aux6: 0_i16,
18982 };
18983 #[cfg(feature = "arbitrary")]
18984 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18985 use arbitrary::{Arbitrary, Unstructured};
18986 let mut buf = [0u8; 1024];
18987 rng.fill_bytes(&mut buf);
18988 let mut unstructured = Unstructured::new(&buf);
18989 Self::arbitrary(&mut unstructured).unwrap_or_default()
18990 }
18991}
18992impl Default for MANUAL_CONTROL_DATA {
18993 fn default() -> Self {
18994 Self::DEFAULT.clone()
18995 }
18996}
18997impl MessageData for MANUAL_CONTROL_DATA {
18998 type Message = MavMessage;
18999 const ID: u32 = 69u32;
19000 const NAME: &'static str = "MANUAL_CONTROL";
19001 const EXTRA_CRC: u8 = 243u8;
19002 const ENCODED_LEN: usize = 30usize;
19003 fn deser(
19004 _version: MavlinkVersion,
19005 __input: &[u8],
19006 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19007 let avail_len = __input.len();
19008 let mut payload_buf = [0; Self::ENCODED_LEN];
19009 let mut buf = if avail_len < Self::ENCODED_LEN {
19010 payload_buf[0..avail_len].copy_from_slice(__input);
19011 Bytes::new(&payload_buf)
19012 } else {
19013 Bytes::new(__input)
19014 };
19015 let mut __struct = Self::default();
19016 __struct.x = buf.get_i16_le()?;
19017 __struct.y = buf.get_i16_le()?;
19018 __struct.z = buf.get_i16_le()?;
19019 __struct.r = buf.get_i16_le()?;
19020 __struct.buttons = buf.get_u16_le()?;
19021 __struct.target = buf.get_u8()?;
19022 __struct.buttons2 = buf.get_u16_le()?;
19023 __struct.enabled_extensions = buf.get_u8()?;
19024 __struct.s = buf.get_i16_le()?;
19025 __struct.t = buf.get_i16_le()?;
19026 __struct.aux1 = buf.get_i16_le()?;
19027 __struct.aux2 = buf.get_i16_le()?;
19028 __struct.aux3 = buf.get_i16_le()?;
19029 __struct.aux4 = buf.get_i16_le()?;
19030 __struct.aux5 = buf.get_i16_le()?;
19031 __struct.aux6 = buf.get_i16_le()?;
19032 Ok(__struct)
19033 }
19034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19035 let mut __tmp = BytesMut::new(bytes);
19036 #[allow(clippy::absurd_extreme_comparisons)]
19037 #[allow(unused_comparisons)]
19038 if __tmp.remaining() < Self::ENCODED_LEN {
19039 panic!(
19040 "buffer is too small (need {} bytes, but got {})",
19041 Self::ENCODED_LEN,
19042 __tmp.remaining(),
19043 )
19044 }
19045 __tmp.put_i16_le(self.x);
19046 __tmp.put_i16_le(self.y);
19047 __tmp.put_i16_le(self.z);
19048 __tmp.put_i16_le(self.r);
19049 __tmp.put_u16_le(self.buttons);
19050 __tmp.put_u8(self.target);
19051 if matches!(version, MavlinkVersion::V2) {
19052 __tmp.put_u16_le(self.buttons2);
19053 __tmp.put_u8(self.enabled_extensions);
19054 __tmp.put_i16_le(self.s);
19055 __tmp.put_i16_le(self.t);
19056 __tmp.put_i16_le(self.aux1);
19057 __tmp.put_i16_le(self.aux2);
19058 __tmp.put_i16_le(self.aux3);
19059 __tmp.put_i16_le(self.aux4);
19060 __tmp.put_i16_le(self.aux5);
19061 __tmp.put_i16_le(self.aux6);
19062 let len = __tmp.len();
19063 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19064 } else {
19065 __tmp.len()
19066 }
19067 }
19068}
19069#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19070#[doc = ""]
19071#[doc = "ID: 81"]
19072#[derive(Debug, Clone, PartialEq)]
19073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19075#[cfg_attr(feature = "ts", derive(TS))]
19076#[cfg_attr(feature = "ts", ts(export))]
19077pub struct MANUAL_SETPOINT_DATA {
19078 #[doc = "Timestamp (time since system boot)."]
19079 pub time_boot_ms: u32,
19080 #[doc = "Desired roll rate"]
19081 pub roll: f32,
19082 #[doc = "Desired pitch rate"]
19083 pub pitch: f32,
19084 #[doc = "Desired yaw rate"]
19085 pub yaw: f32,
19086 #[doc = "Collective thrust, normalized to 0 .. 1"]
19087 pub thrust: f32,
19088 #[doc = "Flight mode switch position, 0.. 255"]
19089 pub mode_switch: u8,
19090 #[doc = "Override mode switch position, 0.. 255"]
19091 pub manual_override_switch: u8,
19092}
19093impl MANUAL_SETPOINT_DATA {
19094 pub const ENCODED_LEN: usize = 22usize;
19095 pub const DEFAULT: Self = Self {
19096 time_boot_ms: 0_u32,
19097 roll: 0.0_f32,
19098 pitch: 0.0_f32,
19099 yaw: 0.0_f32,
19100 thrust: 0.0_f32,
19101 mode_switch: 0_u8,
19102 manual_override_switch: 0_u8,
19103 };
19104 #[cfg(feature = "arbitrary")]
19105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19106 use arbitrary::{Arbitrary, Unstructured};
19107 let mut buf = [0u8; 1024];
19108 rng.fill_bytes(&mut buf);
19109 let mut unstructured = Unstructured::new(&buf);
19110 Self::arbitrary(&mut unstructured).unwrap_or_default()
19111 }
19112}
19113impl Default for MANUAL_SETPOINT_DATA {
19114 fn default() -> Self {
19115 Self::DEFAULT.clone()
19116 }
19117}
19118impl MessageData for MANUAL_SETPOINT_DATA {
19119 type Message = MavMessage;
19120 const ID: u32 = 81u32;
19121 const NAME: &'static str = "MANUAL_SETPOINT";
19122 const EXTRA_CRC: u8 = 106u8;
19123 const ENCODED_LEN: usize = 22usize;
19124 fn deser(
19125 _version: MavlinkVersion,
19126 __input: &[u8],
19127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19128 let avail_len = __input.len();
19129 let mut payload_buf = [0; Self::ENCODED_LEN];
19130 let mut buf = if avail_len < Self::ENCODED_LEN {
19131 payload_buf[0..avail_len].copy_from_slice(__input);
19132 Bytes::new(&payload_buf)
19133 } else {
19134 Bytes::new(__input)
19135 };
19136 let mut __struct = Self::default();
19137 __struct.time_boot_ms = buf.get_u32_le()?;
19138 __struct.roll = buf.get_f32_le()?;
19139 __struct.pitch = buf.get_f32_le()?;
19140 __struct.yaw = buf.get_f32_le()?;
19141 __struct.thrust = buf.get_f32_le()?;
19142 __struct.mode_switch = buf.get_u8()?;
19143 __struct.manual_override_switch = buf.get_u8()?;
19144 Ok(__struct)
19145 }
19146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19147 let mut __tmp = BytesMut::new(bytes);
19148 #[allow(clippy::absurd_extreme_comparisons)]
19149 #[allow(unused_comparisons)]
19150 if __tmp.remaining() < Self::ENCODED_LEN {
19151 panic!(
19152 "buffer is too small (need {} bytes, but got {})",
19153 Self::ENCODED_LEN,
19154 __tmp.remaining(),
19155 )
19156 }
19157 __tmp.put_u32_le(self.time_boot_ms);
19158 __tmp.put_f32_le(self.roll);
19159 __tmp.put_f32_le(self.pitch);
19160 __tmp.put_f32_le(self.yaw);
19161 __tmp.put_f32_le(self.thrust);
19162 __tmp.put_u8(self.mode_switch);
19163 __tmp.put_u8(self.manual_override_switch);
19164 if matches!(version, MavlinkVersion::V2) {
19165 let len = __tmp.len();
19166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19167 } else {
19168 __tmp.len()
19169 }
19170 }
19171}
19172#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19173#[doc = ""]
19174#[doc = "ID: 249"]
19175#[derive(Debug, Clone, PartialEq)]
19176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19178#[cfg_attr(feature = "ts", derive(TS))]
19179#[cfg_attr(feature = "ts", ts(export))]
19180pub struct MEMORY_VECT_DATA {
19181 #[doc = "Starting address of the debug variables"]
19182 pub address: u16,
19183 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19184 pub ver: u8,
19185 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19186 pub mavtype: u8,
19187 #[doc = "Memory contents at specified address"]
19188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19189 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19190 pub value: [i8; 32],
19191}
19192impl MEMORY_VECT_DATA {
19193 pub const ENCODED_LEN: usize = 36usize;
19194 pub const DEFAULT: Self = Self {
19195 address: 0_u16,
19196 ver: 0_u8,
19197 mavtype: 0_u8,
19198 value: [0_i8; 32usize],
19199 };
19200 #[cfg(feature = "arbitrary")]
19201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19202 use arbitrary::{Arbitrary, Unstructured};
19203 let mut buf = [0u8; 1024];
19204 rng.fill_bytes(&mut buf);
19205 let mut unstructured = Unstructured::new(&buf);
19206 Self::arbitrary(&mut unstructured).unwrap_or_default()
19207 }
19208}
19209impl Default for MEMORY_VECT_DATA {
19210 fn default() -> Self {
19211 Self::DEFAULT.clone()
19212 }
19213}
19214impl MessageData for MEMORY_VECT_DATA {
19215 type Message = MavMessage;
19216 const ID: u32 = 249u32;
19217 const NAME: &'static str = "MEMORY_VECT";
19218 const EXTRA_CRC: u8 = 204u8;
19219 const ENCODED_LEN: usize = 36usize;
19220 fn deser(
19221 _version: MavlinkVersion,
19222 __input: &[u8],
19223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19224 let avail_len = __input.len();
19225 let mut payload_buf = [0; Self::ENCODED_LEN];
19226 let mut buf = if avail_len < Self::ENCODED_LEN {
19227 payload_buf[0..avail_len].copy_from_slice(__input);
19228 Bytes::new(&payload_buf)
19229 } else {
19230 Bytes::new(__input)
19231 };
19232 let mut __struct = Self::default();
19233 __struct.address = buf.get_u16_le()?;
19234 __struct.ver = buf.get_u8()?;
19235 __struct.mavtype = buf.get_u8()?;
19236 for v in &mut __struct.value {
19237 let val = buf.get_i8()?;
19238 *v = val;
19239 }
19240 Ok(__struct)
19241 }
19242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19243 let mut __tmp = BytesMut::new(bytes);
19244 #[allow(clippy::absurd_extreme_comparisons)]
19245 #[allow(unused_comparisons)]
19246 if __tmp.remaining() < Self::ENCODED_LEN {
19247 panic!(
19248 "buffer is too small (need {} bytes, but got {})",
19249 Self::ENCODED_LEN,
19250 __tmp.remaining(),
19251 )
19252 }
19253 __tmp.put_u16_le(self.address);
19254 __tmp.put_u8(self.ver);
19255 __tmp.put_u8(self.mavtype);
19256 for val in &self.value {
19257 __tmp.put_i8(*val);
19258 }
19259 if matches!(version, MavlinkVersion::V2) {
19260 let len = __tmp.len();
19261 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19262 } else {
19263 __tmp.len()
19264 }
19265 }
19266}
19267#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19268#[doc = ""]
19269#[doc = "ID: 244"]
19270#[derive(Debug, Clone, PartialEq)]
19271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19273#[cfg_attr(feature = "ts", derive(TS))]
19274#[cfg_attr(feature = "ts", ts(export))]
19275pub struct MESSAGE_INTERVAL_DATA {
19276 #[doc = "The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available,>0 indicates the interval at which it is sent."]
19277 pub interval_us: i32,
19278 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19279 pub message_id: u16,
19280}
19281impl MESSAGE_INTERVAL_DATA {
19282 pub const ENCODED_LEN: usize = 6usize;
19283 pub const DEFAULT: Self = Self {
19284 interval_us: 0_i32,
19285 message_id: 0_u16,
19286 };
19287 #[cfg(feature = "arbitrary")]
19288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19289 use arbitrary::{Arbitrary, Unstructured};
19290 let mut buf = [0u8; 1024];
19291 rng.fill_bytes(&mut buf);
19292 let mut unstructured = Unstructured::new(&buf);
19293 Self::arbitrary(&mut unstructured).unwrap_or_default()
19294 }
19295}
19296impl Default for MESSAGE_INTERVAL_DATA {
19297 fn default() -> Self {
19298 Self::DEFAULT.clone()
19299 }
19300}
19301impl MessageData for MESSAGE_INTERVAL_DATA {
19302 type Message = MavMessage;
19303 const ID: u32 = 244u32;
19304 const NAME: &'static str = "MESSAGE_INTERVAL";
19305 const EXTRA_CRC: u8 = 95u8;
19306 const ENCODED_LEN: usize = 6usize;
19307 fn deser(
19308 _version: MavlinkVersion,
19309 __input: &[u8],
19310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19311 let avail_len = __input.len();
19312 let mut payload_buf = [0; Self::ENCODED_LEN];
19313 let mut buf = if avail_len < Self::ENCODED_LEN {
19314 payload_buf[0..avail_len].copy_from_slice(__input);
19315 Bytes::new(&payload_buf)
19316 } else {
19317 Bytes::new(__input)
19318 };
19319 let mut __struct = Self::default();
19320 __struct.interval_us = buf.get_i32_le()?;
19321 __struct.message_id = buf.get_u16_le()?;
19322 Ok(__struct)
19323 }
19324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19325 let mut __tmp = BytesMut::new(bytes);
19326 #[allow(clippy::absurd_extreme_comparisons)]
19327 #[allow(unused_comparisons)]
19328 if __tmp.remaining() < Self::ENCODED_LEN {
19329 panic!(
19330 "buffer is too small (need {} bytes, but got {})",
19331 Self::ENCODED_LEN,
19332 __tmp.remaining(),
19333 )
19334 }
19335 __tmp.put_i32_le(self.interval_us);
19336 __tmp.put_u16_le(self.message_id);
19337 if matches!(version, MavlinkVersion::V2) {
19338 let len = __tmp.len();
19339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19340 } else {
19341 __tmp.len()
19342 }
19343 }
19344}
19345#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19346#[doc = ""]
19347#[doc = "ID: 47"]
19348#[derive(Debug, Clone, PartialEq)]
19349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19351#[cfg_attr(feature = "ts", derive(TS))]
19352#[cfg_attr(feature = "ts", ts(export))]
19353pub struct MISSION_ACK_DATA {
19354 #[doc = "System ID"]
19355 pub target_system: u8,
19356 #[doc = "Component ID"]
19357 pub target_component: u8,
19358 #[doc = "Mission result."]
19359 pub mavtype: MavMissionResult,
19360 #[doc = "Mission type."]
19361 #[cfg_attr(feature = "serde", serde(default))]
19362 pub mission_type: MavMissionType,
19363 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19365 pub opaque_id: u32,
19366}
19367impl MISSION_ACK_DATA {
19368 pub const ENCODED_LEN: usize = 8usize;
19369 pub const DEFAULT: Self = Self {
19370 target_system: 0_u8,
19371 target_component: 0_u8,
19372 mavtype: MavMissionResult::DEFAULT,
19373 mission_type: MavMissionType::DEFAULT,
19374 opaque_id: 0_u32,
19375 };
19376 #[cfg(feature = "arbitrary")]
19377 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19378 use arbitrary::{Arbitrary, Unstructured};
19379 let mut buf = [0u8; 1024];
19380 rng.fill_bytes(&mut buf);
19381 let mut unstructured = Unstructured::new(&buf);
19382 Self::arbitrary(&mut unstructured).unwrap_or_default()
19383 }
19384}
19385impl Default for MISSION_ACK_DATA {
19386 fn default() -> Self {
19387 Self::DEFAULT.clone()
19388 }
19389}
19390impl MessageData for MISSION_ACK_DATA {
19391 type Message = MavMessage;
19392 const ID: u32 = 47u32;
19393 const NAME: &'static str = "MISSION_ACK";
19394 const EXTRA_CRC: u8 = 153u8;
19395 const ENCODED_LEN: usize = 8usize;
19396 fn deser(
19397 _version: MavlinkVersion,
19398 __input: &[u8],
19399 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19400 let avail_len = __input.len();
19401 let mut payload_buf = [0; Self::ENCODED_LEN];
19402 let mut buf = if avail_len < Self::ENCODED_LEN {
19403 payload_buf[0..avail_len].copy_from_slice(__input);
19404 Bytes::new(&payload_buf)
19405 } else {
19406 Bytes::new(__input)
19407 };
19408 let mut __struct = Self::default();
19409 __struct.target_system = buf.get_u8()?;
19410 __struct.target_component = buf.get_u8()?;
19411 let tmp = buf.get_u8()?;
19412 __struct.mavtype =
19413 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19414 enum_type: "MavMissionResult",
19415 value: tmp as u64,
19416 })?;
19417 let tmp = buf.get_u8()?;
19418 __struct.mission_type =
19419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19420 enum_type: "MavMissionType",
19421 value: tmp as u64,
19422 })?;
19423 __struct.opaque_id = buf.get_u32_le()?;
19424 Ok(__struct)
19425 }
19426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19427 let mut __tmp = BytesMut::new(bytes);
19428 #[allow(clippy::absurd_extreme_comparisons)]
19429 #[allow(unused_comparisons)]
19430 if __tmp.remaining() < Self::ENCODED_LEN {
19431 panic!(
19432 "buffer is too small (need {} bytes, but got {})",
19433 Self::ENCODED_LEN,
19434 __tmp.remaining(),
19435 )
19436 }
19437 __tmp.put_u8(self.target_system);
19438 __tmp.put_u8(self.target_component);
19439 __tmp.put_u8(self.mavtype as u8);
19440 if matches!(version, MavlinkVersion::V2) {
19441 __tmp.put_u8(self.mission_type as u8);
19442 __tmp.put_u32_le(self.opaque_id);
19443 let len = __tmp.len();
19444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19445 } else {
19446 __tmp.len()
19447 }
19448 }
19449}
19450#[doc = "Delete all mission items at once."]
19451#[doc = ""]
19452#[doc = "ID: 45"]
19453#[derive(Debug, Clone, PartialEq)]
19454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19456#[cfg_attr(feature = "ts", derive(TS))]
19457#[cfg_attr(feature = "ts", ts(export))]
19458pub struct MISSION_CLEAR_ALL_DATA {
19459 #[doc = "System ID"]
19460 pub target_system: u8,
19461 #[doc = "Component ID"]
19462 pub target_component: u8,
19463 #[doc = "Mission type."]
19464 #[cfg_attr(feature = "serde", serde(default))]
19465 pub mission_type: MavMissionType,
19466}
19467impl MISSION_CLEAR_ALL_DATA {
19468 pub const ENCODED_LEN: usize = 3usize;
19469 pub const DEFAULT: Self = Self {
19470 target_system: 0_u8,
19471 target_component: 0_u8,
19472 mission_type: MavMissionType::DEFAULT,
19473 };
19474 #[cfg(feature = "arbitrary")]
19475 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19476 use arbitrary::{Arbitrary, Unstructured};
19477 let mut buf = [0u8; 1024];
19478 rng.fill_bytes(&mut buf);
19479 let mut unstructured = Unstructured::new(&buf);
19480 Self::arbitrary(&mut unstructured).unwrap_or_default()
19481 }
19482}
19483impl Default for MISSION_CLEAR_ALL_DATA {
19484 fn default() -> Self {
19485 Self::DEFAULT.clone()
19486 }
19487}
19488impl MessageData for MISSION_CLEAR_ALL_DATA {
19489 type Message = MavMessage;
19490 const ID: u32 = 45u32;
19491 const NAME: &'static str = "MISSION_CLEAR_ALL";
19492 const EXTRA_CRC: u8 = 232u8;
19493 const ENCODED_LEN: usize = 3usize;
19494 fn deser(
19495 _version: MavlinkVersion,
19496 __input: &[u8],
19497 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19498 let avail_len = __input.len();
19499 let mut payload_buf = [0; Self::ENCODED_LEN];
19500 let mut buf = if avail_len < Self::ENCODED_LEN {
19501 payload_buf[0..avail_len].copy_from_slice(__input);
19502 Bytes::new(&payload_buf)
19503 } else {
19504 Bytes::new(__input)
19505 };
19506 let mut __struct = Self::default();
19507 __struct.target_system = buf.get_u8()?;
19508 __struct.target_component = buf.get_u8()?;
19509 let tmp = buf.get_u8()?;
19510 __struct.mission_type =
19511 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19512 enum_type: "MavMissionType",
19513 value: tmp as u64,
19514 })?;
19515 Ok(__struct)
19516 }
19517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19518 let mut __tmp = BytesMut::new(bytes);
19519 #[allow(clippy::absurd_extreme_comparisons)]
19520 #[allow(unused_comparisons)]
19521 if __tmp.remaining() < Self::ENCODED_LEN {
19522 panic!(
19523 "buffer is too small (need {} bytes, but got {})",
19524 Self::ENCODED_LEN,
19525 __tmp.remaining(),
19526 )
19527 }
19528 __tmp.put_u8(self.target_system);
19529 __tmp.put_u8(self.target_component);
19530 if matches!(version, MavlinkVersion::V2) {
19531 __tmp.put_u8(self.mission_type as u8);
19532 let len = __tmp.len();
19533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19534 } else {
19535 __tmp.len()
19536 }
19537 }
19538}
19539#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19540#[doc = ""]
19541#[doc = "ID: 44"]
19542#[derive(Debug, Clone, PartialEq)]
19543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19545#[cfg_attr(feature = "ts", derive(TS))]
19546#[cfg_attr(feature = "ts", ts(export))]
19547pub struct MISSION_COUNT_DATA {
19548 #[doc = "Number of mission items in the sequence"]
19549 pub count: u16,
19550 #[doc = "System ID"]
19551 pub target_system: u8,
19552 #[doc = "Component ID"]
19553 pub target_component: u8,
19554 #[doc = "Mission type."]
19555 #[cfg_attr(feature = "serde", serde(default))]
19556 pub mission_type: MavMissionType,
19557 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19558 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19559 pub opaque_id: u32,
19560}
19561impl MISSION_COUNT_DATA {
19562 pub const ENCODED_LEN: usize = 9usize;
19563 pub const DEFAULT: Self = Self {
19564 count: 0_u16,
19565 target_system: 0_u8,
19566 target_component: 0_u8,
19567 mission_type: MavMissionType::DEFAULT,
19568 opaque_id: 0_u32,
19569 };
19570 #[cfg(feature = "arbitrary")]
19571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19572 use arbitrary::{Arbitrary, Unstructured};
19573 let mut buf = [0u8; 1024];
19574 rng.fill_bytes(&mut buf);
19575 let mut unstructured = Unstructured::new(&buf);
19576 Self::arbitrary(&mut unstructured).unwrap_or_default()
19577 }
19578}
19579impl Default for MISSION_COUNT_DATA {
19580 fn default() -> Self {
19581 Self::DEFAULT.clone()
19582 }
19583}
19584impl MessageData for MISSION_COUNT_DATA {
19585 type Message = MavMessage;
19586 const ID: u32 = 44u32;
19587 const NAME: &'static str = "MISSION_COUNT";
19588 const EXTRA_CRC: u8 = 221u8;
19589 const ENCODED_LEN: usize = 9usize;
19590 fn deser(
19591 _version: MavlinkVersion,
19592 __input: &[u8],
19593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19594 let avail_len = __input.len();
19595 let mut payload_buf = [0; Self::ENCODED_LEN];
19596 let mut buf = if avail_len < Self::ENCODED_LEN {
19597 payload_buf[0..avail_len].copy_from_slice(__input);
19598 Bytes::new(&payload_buf)
19599 } else {
19600 Bytes::new(__input)
19601 };
19602 let mut __struct = Self::default();
19603 __struct.count = buf.get_u16_le()?;
19604 __struct.target_system = buf.get_u8()?;
19605 __struct.target_component = buf.get_u8()?;
19606 let tmp = buf.get_u8()?;
19607 __struct.mission_type =
19608 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19609 enum_type: "MavMissionType",
19610 value: tmp as u64,
19611 })?;
19612 __struct.opaque_id = buf.get_u32_le()?;
19613 Ok(__struct)
19614 }
19615 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19616 let mut __tmp = BytesMut::new(bytes);
19617 #[allow(clippy::absurd_extreme_comparisons)]
19618 #[allow(unused_comparisons)]
19619 if __tmp.remaining() < Self::ENCODED_LEN {
19620 panic!(
19621 "buffer is too small (need {} bytes, but got {})",
19622 Self::ENCODED_LEN,
19623 __tmp.remaining(),
19624 )
19625 }
19626 __tmp.put_u16_le(self.count);
19627 __tmp.put_u8(self.target_system);
19628 __tmp.put_u8(self.target_component);
19629 if matches!(version, MavlinkVersion::V2) {
19630 __tmp.put_u8(self.mission_type as u8);
19631 __tmp.put_u32_le(self.opaque_id);
19632 let len = __tmp.len();
19633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19634 } else {
19635 __tmp.len()
19636 }
19637 }
19638}
19639#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19640#[doc = ""]
19641#[doc = "ID: 42"]
19642#[derive(Debug, Clone, PartialEq)]
19643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19645#[cfg_attr(feature = "ts", derive(TS))]
19646#[cfg_attr(feature = "ts", ts(export))]
19647pub struct MISSION_CURRENT_DATA {
19648 #[doc = "Sequence"]
19649 pub seq: u16,
19650 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19652 pub total: u16,
19653 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19654 #[cfg_attr(feature = "serde", serde(default))]
19655 pub mission_state: MissionState,
19656 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19658 pub mission_mode: u8,
19659 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19660 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19661 pub mission_id: u32,
19662 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19663 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19664 pub fence_id: u32,
19665 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19666 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19667 pub rally_points_id: u32,
19668}
19669impl MISSION_CURRENT_DATA {
19670 pub const ENCODED_LEN: usize = 18usize;
19671 pub const DEFAULT: Self = Self {
19672 seq: 0_u16,
19673 total: 0_u16,
19674 mission_state: MissionState::DEFAULT,
19675 mission_mode: 0_u8,
19676 mission_id: 0_u32,
19677 fence_id: 0_u32,
19678 rally_points_id: 0_u32,
19679 };
19680 #[cfg(feature = "arbitrary")]
19681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19682 use arbitrary::{Arbitrary, Unstructured};
19683 let mut buf = [0u8; 1024];
19684 rng.fill_bytes(&mut buf);
19685 let mut unstructured = Unstructured::new(&buf);
19686 Self::arbitrary(&mut unstructured).unwrap_or_default()
19687 }
19688}
19689impl Default for MISSION_CURRENT_DATA {
19690 fn default() -> Self {
19691 Self::DEFAULT.clone()
19692 }
19693}
19694impl MessageData for MISSION_CURRENT_DATA {
19695 type Message = MavMessage;
19696 const ID: u32 = 42u32;
19697 const NAME: &'static str = "MISSION_CURRENT";
19698 const EXTRA_CRC: u8 = 28u8;
19699 const ENCODED_LEN: usize = 18usize;
19700 fn deser(
19701 _version: MavlinkVersion,
19702 __input: &[u8],
19703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19704 let avail_len = __input.len();
19705 let mut payload_buf = [0; Self::ENCODED_LEN];
19706 let mut buf = if avail_len < Self::ENCODED_LEN {
19707 payload_buf[0..avail_len].copy_from_slice(__input);
19708 Bytes::new(&payload_buf)
19709 } else {
19710 Bytes::new(__input)
19711 };
19712 let mut __struct = Self::default();
19713 __struct.seq = buf.get_u16_le()?;
19714 __struct.total = buf.get_u16_le()?;
19715 let tmp = buf.get_u8()?;
19716 __struct.mission_state =
19717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19718 enum_type: "MissionState",
19719 value: tmp as u64,
19720 })?;
19721 __struct.mission_mode = buf.get_u8()?;
19722 __struct.mission_id = buf.get_u32_le()?;
19723 __struct.fence_id = buf.get_u32_le()?;
19724 __struct.rally_points_id = buf.get_u32_le()?;
19725 Ok(__struct)
19726 }
19727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19728 let mut __tmp = BytesMut::new(bytes);
19729 #[allow(clippy::absurd_extreme_comparisons)]
19730 #[allow(unused_comparisons)]
19731 if __tmp.remaining() < Self::ENCODED_LEN {
19732 panic!(
19733 "buffer is too small (need {} bytes, but got {})",
19734 Self::ENCODED_LEN,
19735 __tmp.remaining(),
19736 )
19737 }
19738 __tmp.put_u16_le(self.seq);
19739 if matches!(version, MavlinkVersion::V2) {
19740 __tmp.put_u16_le(self.total);
19741 __tmp.put_u8(self.mission_state as u8);
19742 __tmp.put_u8(self.mission_mode);
19743 __tmp.put_u32_le(self.mission_id);
19744 __tmp.put_u32_le(self.fence_id);
19745 __tmp.put_u32_le(self.rally_points_id);
19746 let len = __tmp.len();
19747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19748 } else {
19749 __tmp.len()
19750 }
19751 }
19752}
19753#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19754#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19755#[doc = ""]
19756#[doc = "ID: 39"]
19757#[derive(Debug, Clone, PartialEq)]
19758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19760#[cfg_attr(feature = "ts", derive(TS))]
19761#[cfg_attr(feature = "ts", ts(export))]
19762pub struct MISSION_ITEM_DATA {
19763 #[doc = "PARAM1, see MAV_CMD enum"]
19764 pub param1: f32,
19765 #[doc = "PARAM2, see MAV_CMD enum"]
19766 pub param2: f32,
19767 #[doc = "PARAM3, see MAV_CMD enum"]
19768 pub param3: f32,
19769 #[doc = "PARAM4, see MAV_CMD enum"]
19770 pub param4: f32,
19771 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19772 pub x: f32,
19773 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19774 pub y: f32,
19775 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19776 pub z: f32,
19777 #[doc = "Sequence"]
19778 pub seq: u16,
19779 #[doc = "The scheduled action for the waypoint."]
19780 pub command: MavCmd,
19781 #[doc = "System ID"]
19782 pub target_system: u8,
19783 #[doc = "Component ID"]
19784 pub target_component: u8,
19785 #[doc = "The coordinate system of the waypoint."]
19786 pub frame: MavFrame,
19787 #[doc = "false:0, true:1"]
19788 pub current: u8,
19789 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19790 pub autocontinue: u8,
19791 #[doc = "Mission type."]
19792 #[cfg_attr(feature = "serde", serde(default))]
19793 pub mission_type: MavMissionType,
19794}
19795impl MISSION_ITEM_DATA {
19796 pub const ENCODED_LEN: usize = 38usize;
19797 pub const DEFAULT: Self = Self {
19798 param1: 0.0_f32,
19799 param2: 0.0_f32,
19800 param3: 0.0_f32,
19801 param4: 0.0_f32,
19802 x: 0.0_f32,
19803 y: 0.0_f32,
19804 z: 0.0_f32,
19805 seq: 0_u16,
19806 command: MavCmd::DEFAULT,
19807 target_system: 0_u8,
19808 target_component: 0_u8,
19809 frame: MavFrame::DEFAULT,
19810 current: 0_u8,
19811 autocontinue: 0_u8,
19812 mission_type: MavMissionType::DEFAULT,
19813 };
19814 #[cfg(feature = "arbitrary")]
19815 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19816 use arbitrary::{Arbitrary, Unstructured};
19817 let mut buf = [0u8; 1024];
19818 rng.fill_bytes(&mut buf);
19819 let mut unstructured = Unstructured::new(&buf);
19820 Self::arbitrary(&mut unstructured).unwrap_or_default()
19821 }
19822}
19823impl Default for MISSION_ITEM_DATA {
19824 fn default() -> Self {
19825 Self::DEFAULT.clone()
19826 }
19827}
19828impl MessageData for MISSION_ITEM_DATA {
19829 type Message = MavMessage;
19830 const ID: u32 = 39u32;
19831 const NAME: &'static str = "MISSION_ITEM";
19832 const EXTRA_CRC: u8 = 254u8;
19833 const ENCODED_LEN: usize = 38usize;
19834 fn deser(
19835 _version: MavlinkVersion,
19836 __input: &[u8],
19837 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19838 let avail_len = __input.len();
19839 let mut payload_buf = [0; Self::ENCODED_LEN];
19840 let mut buf = if avail_len < Self::ENCODED_LEN {
19841 payload_buf[0..avail_len].copy_from_slice(__input);
19842 Bytes::new(&payload_buf)
19843 } else {
19844 Bytes::new(__input)
19845 };
19846 let mut __struct = Self::default();
19847 __struct.param1 = buf.get_f32_le()?;
19848 __struct.param2 = buf.get_f32_le()?;
19849 __struct.param3 = buf.get_f32_le()?;
19850 __struct.param4 = buf.get_f32_le()?;
19851 __struct.x = buf.get_f32_le()?;
19852 __struct.y = buf.get_f32_le()?;
19853 __struct.z = buf.get_f32_le()?;
19854 __struct.seq = buf.get_u16_le()?;
19855 let tmp = buf.get_u16_le()?;
19856 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19857 ::mavlink_core::error::ParserError::InvalidEnum {
19858 enum_type: "MavCmd",
19859 value: tmp as u64,
19860 },
19861 )?;
19862 __struct.target_system = buf.get_u8()?;
19863 __struct.target_component = buf.get_u8()?;
19864 let tmp = buf.get_u8()?;
19865 __struct.frame =
19866 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19867 enum_type: "MavFrame",
19868 value: tmp as u64,
19869 })?;
19870 __struct.current = buf.get_u8()?;
19871 __struct.autocontinue = buf.get_u8()?;
19872 let tmp = buf.get_u8()?;
19873 __struct.mission_type =
19874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19875 enum_type: "MavMissionType",
19876 value: tmp as u64,
19877 })?;
19878 Ok(__struct)
19879 }
19880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19881 let mut __tmp = BytesMut::new(bytes);
19882 #[allow(clippy::absurd_extreme_comparisons)]
19883 #[allow(unused_comparisons)]
19884 if __tmp.remaining() < Self::ENCODED_LEN {
19885 panic!(
19886 "buffer is too small (need {} bytes, but got {})",
19887 Self::ENCODED_LEN,
19888 __tmp.remaining(),
19889 )
19890 }
19891 __tmp.put_f32_le(self.param1);
19892 __tmp.put_f32_le(self.param2);
19893 __tmp.put_f32_le(self.param3);
19894 __tmp.put_f32_le(self.param4);
19895 __tmp.put_f32_le(self.x);
19896 __tmp.put_f32_le(self.y);
19897 __tmp.put_f32_le(self.z);
19898 __tmp.put_u16_le(self.seq);
19899 __tmp.put_u16_le(self.command as u16);
19900 __tmp.put_u8(self.target_system);
19901 __tmp.put_u8(self.target_component);
19902 __tmp.put_u8(self.frame as u8);
19903 __tmp.put_u8(self.current);
19904 __tmp.put_u8(self.autocontinue);
19905 if matches!(version, MavlinkVersion::V2) {
19906 __tmp.put_u8(self.mission_type as u8);
19907 let len = __tmp.len();
19908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19909 } else {
19910 __tmp.len()
19911 }
19912 }
19913}
19914#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19915#[doc = ""]
19916#[doc = "ID: 73"]
19917#[derive(Debug, Clone, PartialEq)]
19918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19920#[cfg_attr(feature = "ts", derive(TS))]
19921#[cfg_attr(feature = "ts", ts(export))]
19922pub struct MISSION_ITEM_INT_DATA {
19923 #[doc = "PARAM1, see MAV_CMD enum"]
19924 pub param1: f32,
19925 #[doc = "PARAM2, see MAV_CMD enum"]
19926 pub param2: f32,
19927 #[doc = "PARAM3, see MAV_CMD enum"]
19928 pub param3: f32,
19929 #[doc = "PARAM4, see MAV_CMD enum"]
19930 pub param4: f32,
19931 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19932 pub x: i32,
19933 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19934 pub y: i32,
19935 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19936 pub z: f32,
19937 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19938 pub seq: u16,
19939 #[doc = "The scheduled action for the waypoint."]
19940 pub command: MavCmd,
19941 #[doc = "System ID"]
19942 pub target_system: u8,
19943 #[doc = "Component ID"]
19944 pub target_component: u8,
19945 #[doc = "The coordinate system of the waypoint."]
19946 pub frame: MavFrame,
19947 #[doc = "false:0, true:1"]
19948 pub current: u8,
19949 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19950 pub autocontinue: u8,
19951 #[doc = "Mission type."]
19952 #[cfg_attr(feature = "serde", serde(default))]
19953 pub mission_type: MavMissionType,
19954}
19955impl MISSION_ITEM_INT_DATA {
19956 pub const ENCODED_LEN: usize = 38usize;
19957 pub const DEFAULT: Self = Self {
19958 param1: 0.0_f32,
19959 param2: 0.0_f32,
19960 param3: 0.0_f32,
19961 param4: 0.0_f32,
19962 x: 0_i32,
19963 y: 0_i32,
19964 z: 0.0_f32,
19965 seq: 0_u16,
19966 command: MavCmd::DEFAULT,
19967 target_system: 0_u8,
19968 target_component: 0_u8,
19969 frame: MavFrame::DEFAULT,
19970 current: 0_u8,
19971 autocontinue: 0_u8,
19972 mission_type: MavMissionType::DEFAULT,
19973 };
19974 #[cfg(feature = "arbitrary")]
19975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19976 use arbitrary::{Arbitrary, Unstructured};
19977 let mut buf = [0u8; 1024];
19978 rng.fill_bytes(&mut buf);
19979 let mut unstructured = Unstructured::new(&buf);
19980 Self::arbitrary(&mut unstructured).unwrap_or_default()
19981 }
19982}
19983impl Default for MISSION_ITEM_INT_DATA {
19984 fn default() -> Self {
19985 Self::DEFAULT.clone()
19986 }
19987}
19988impl MessageData for MISSION_ITEM_INT_DATA {
19989 type Message = MavMessage;
19990 const ID: u32 = 73u32;
19991 const NAME: &'static str = "MISSION_ITEM_INT";
19992 const EXTRA_CRC: u8 = 38u8;
19993 const ENCODED_LEN: usize = 38usize;
19994 fn deser(
19995 _version: MavlinkVersion,
19996 __input: &[u8],
19997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19998 let avail_len = __input.len();
19999 let mut payload_buf = [0; Self::ENCODED_LEN];
20000 let mut buf = if avail_len < Self::ENCODED_LEN {
20001 payload_buf[0..avail_len].copy_from_slice(__input);
20002 Bytes::new(&payload_buf)
20003 } else {
20004 Bytes::new(__input)
20005 };
20006 let mut __struct = Self::default();
20007 __struct.param1 = buf.get_f32_le()?;
20008 __struct.param2 = buf.get_f32_le()?;
20009 __struct.param3 = buf.get_f32_le()?;
20010 __struct.param4 = buf.get_f32_le()?;
20011 __struct.x = buf.get_i32_le()?;
20012 __struct.y = buf.get_i32_le()?;
20013 __struct.z = buf.get_f32_le()?;
20014 __struct.seq = buf.get_u16_le()?;
20015 let tmp = buf.get_u16_le()?;
20016 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20017 ::mavlink_core::error::ParserError::InvalidEnum {
20018 enum_type: "MavCmd",
20019 value: tmp as u64,
20020 },
20021 )?;
20022 __struct.target_system = buf.get_u8()?;
20023 __struct.target_component = buf.get_u8()?;
20024 let tmp = buf.get_u8()?;
20025 __struct.frame =
20026 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20027 enum_type: "MavFrame",
20028 value: tmp as u64,
20029 })?;
20030 __struct.current = buf.get_u8()?;
20031 __struct.autocontinue = buf.get_u8()?;
20032 let tmp = buf.get_u8()?;
20033 __struct.mission_type =
20034 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20035 enum_type: "MavMissionType",
20036 value: tmp as u64,
20037 })?;
20038 Ok(__struct)
20039 }
20040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20041 let mut __tmp = BytesMut::new(bytes);
20042 #[allow(clippy::absurd_extreme_comparisons)]
20043 #[allow(unused_comparisons)]
20044 if __tmp.remaining() < Self::ENCODED_LEN {
20045 panic!(
20046 "buffer is too small (need {} bytes, but got {})",
20047 Self::ENCODED_LEN,
20048 __tmp.remaining(),
20049 )
20050 }
20051 __tmp.put_f32_le(self.param1);
20052 __tmp.put_f32_le(self.param2);
20053 __tmp.put_f32_le(self.param3);
20054 __tmp.put_f32_le(self.param4);
20055 __tmp.put_i32_le(self.x);
20056 __tmp.put_i32_le(self.y);
20057 __tmp.put_f32_le(self.z);
20058 __tmp.put_u16_le(self.seq);
20059 __tmp.put_u16_le(self.command as u16);
20060 __tmp.put_u8(self.target_system);
20061 __tmp.put_u8(self.target_component);
20062 __tmp.put_u8(self.frame as u8);
20063 __tmp.put_u8(self.current);
20064 __tmp.put_u8(self.autocontinue);
20065 if matches!(version, MavlinkVersion::V2) {
20066 __tmp.put_u8(self.mission_type as u8);
20067 let len = __tmp.len();
20068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20069 } else {
20070 __tmp.len()
20071 }
20072 }
20073}
20074#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20075#[doc = ""]
20076#[doc = "ID: 46"]
20077#[derive(Debug, Clone, PartialEq)]
20078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20080#[cfg_attr(feature = "ts", derive(TS))]
20081#[cfg_attr(feature = "ts", ts(export))]
20082pub struct MISSION_ITEM_REACHED_DATA {
20083 #[doc = "Sequence"]
20084 pub seq: u16,
20085}
20086impl MISSION_ITEM_REACHED_DATA {
20087 pub const ENCODED_LEN: usize = 2usize;
20088 pub const DEFAULT: Self = Self { seq: 0_u16 };
20089 #[cfg(feature = "arbitrary")]
20090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20091 use arbitrary::{Arbitrary, Unstructured};
20092 let mut buf = [0u8; 1024];
20093 rng.fill_bytes(&mut buf);
20094 let mut unstructured = Unstructured::new(&buf);
20095 Self::arbitrary(&mut unstructured).unwrap_or_default()
20096 }
20097}
20098impl Default for MISSION_ITEM_REACHED_DATA {
20099 fn default() -> Self {
20100 Self::DEFAULT.clone()
20101 }
20102}
20103impl MessageData for MISSION_ITEM_REACHED_DATA {
20104 type Message = MavMessage;
20105 const ID: u32 = 46u32;
20106 const NAME: &'static str = "MISSION_ITEM_REACHED";
20107 const EXTRA_CRC: u8 = 11u8;
20108 const ENCODED_LEN: usize = 2usize;
20109 fn deser(
20110 _version: MavlinkVersion,
20111 __input: &[u8],
20112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20113 let avail_len = __input.len();
20114 let mut payload_buf = [0; Self::ENCODED_LEN];
20115 let mut buf = if avail_len < Self::ENCODED_LEN {
20116 payload_buf[0..avail_len].copy_from_slice(__input);
20117 Bytes::new(&payload_buf)
20118 } else {
20119 Bytes::new(__input)
20120 };
20121 let mut __struct = Self::default();
20122 __struct.seq = buf.get_u16_le()?;
20123 Ok(__struct)
20124 }
20125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20126 let mut __tmp = BytesMut::new(bytes);
20127 #[allow(clippy::absurd_extreme_comparisons)]
20128 #[allow(unused_comparisons)]
20129 if __tmp.remaining() < Self::ENCODED_LEN {
20130 panic!(
20131 "buffer is too small (need {} bytes, but got {})",
20132 Self::ENCODED_LEN,
20133 __tmp.remaining(),
20134 )
20135 }
20136 __tmp.put_u16_le(self.seq);
20137 if matches!(version, MavlinkVersion::V2) {
20138 let len = __tmp.len();
20139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20140 } else {
20141 __tmp.len()
20142 }
20143 }
20144}
20145#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20146#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20147#[doc = ""]
20148#[doc = "ID: 40"]
20149#[derive(Debug, Clone, PartialEq)]
20150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20152#[cfg_attr(feature = "ts", derive(TS))]
20153#[cfg_attr(feature = "ts", ts(export))]
20154pub struct MISSION_REQUEST_DATA {
20155 #[doc = "Sequence"]
20156 pub seq: u16,
20157 #[doc = "System ID"]
20158 pub target_system: u8,
20159 #[doc = "Component ID"]
20160 pub target_component: u8,
20161 #[doc = "Mission type."]
20162 #[cfg_attr(feature = "serde", serde(default))]
20163 pub mission_type: MavMissionType,
20164}
20165impl MISSION_REQUEST_DATA {
20166 pub const ENCODED_LEN: usize = 5usize;
20167 pub const DEFAULT: Self = Self {
20168 seq: 0_u16,
20169 target_system: 0_u8,
20170 target_component: 0_u8,
20171 mission_type: MavMissionType::DEFAULT,
20172 };
20173 #[cfg(feature = "arbitrary")]
20174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20175 use arbitrary::{Arbitrary, Unstructured};
20176 let mut buf = [0u8; 1024];
20177 rng.fill_bytes(&mut buf);
20178 let mut unstructured = Unstructured::new(&buf);
20179 Self::arbitrary(&mut unstructured).unwrap_or_default()
20180 }
20181}
20182impl Default for MISSION_REQUEST_DATA {
20183 fn default() -> Self {
20184 Self::DEFAULT.clone()
20185 }
20186}
20187impl MessageData for MISSION_REQUEST_DATA {
20188 type Message = MavMessage;
20189 const ID: u32 = 40u32;
20190 const NAME: &'static str = "MISSION_REQUEST";
20191 const EXTRA_CRC: u8 = 230u8;
20192 const ENCODED_LEN: usize = 5usize;
20193 fn deser(
20194 _version: MavlinkVersion,
20195 __input: &[u8],
20196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20197 let avail_len = __input.len();
20198 let mut payload_buf = [0; Self::ENCODED_LEN];
20199 let mut buf = if avail_len < Self::ENCODED_LEN {
20200 payload_buf[0..avail_len].copy_from_slice(__input);
20201 Bytes::new(&payload_buf)
20202 } else {
20203 Bytes::new(__input)
20204 };
20205 let mut __struct = Self::default();
20206 __struct.seq = buf.get_u16_le()?;
20207 __struct.target_system = buf.get_u8()?;
20208 __struct.target_component = buf.get_u8()?;
20209 let tmp = buf.get_u8()?;
20210 __struct.mission_type =
20211 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20212 enum_type: "MavMissionType",
20213 value: tmp as u64,
20214 })?;
20215 Ok(__struct)
20216 }
20217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20218 let mut __tmp = BytesMut::new(bytes);
20219 #[allow(clippy::absurd_extreme_comparisons)]
20220 #[allow(unused_comparisons)]
20221 if __tmp.remaining() < Self::ENCODED_LEN {
20222 panic!(
20223 "buffer is too small (need {} bytes, but got {})",
20224 Self::ENCODED_LEN,
20225 __tmp.remaining(),
20226 )
20227 }
20228 __tmp.put_u16_le(self.seq);
20229 __tmp.put_u8(self.target_system);
20230 __tmp.put_u8(self.target_component);
20231 if matches!(version, MavlinkVersion::V2) {
20232 __tmp.put_u8(self.mission_type as u8);
20233 let len = __tmp.len();
20234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20235 } else {
20236 __tmp.len()
20237 }
20238 }
20239}
20240#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20241#[doc = ""]
20242#[doc = "ID: 51"]
20243#[derive(Debug, Clone, PartialEq)]
20244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20246#[cfg_attr(feature = "ts", derive(TS))]
20247#[cfg_attr(feature = "ts", ts(export))]
20248pub struct MISSION_REQUEST_INT_DATA {
20249 #[doc = "Sequence"]
20250 pub seq: u16,
20251 #[doc = "System ID"]
20252 pub target_system: u8,
20253 #[doc = "Component ID"]
20254 pub target_component: u8,
20255 #[doc = "Mission type."]
20256 #[cfg_attr(feature = "serde", serde(default))]
20257 pub mission_type: MavMissionType,
20258}
20259impl MISSION_REQUEST_INT_DATA {
20260 pub const ENCODED_LEN: usize = 5usize;
20261 pub const DEFAULT: Self = Self {
20262 seq: 0_u16,
20263 target_system: 0_u8,
20264 target_component: 0_u8,
20265 mission_type: MavMissionType::DEFAULT,
20266 };
20267 #[cfg(feature = "arbitrary")]
20268 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20269 use arbitrary::{Arbitrary, Unstructured};
20270 let mut buf = [0u8; 1024];
20271 rng.fill_bytes(&mut buf);
20272 let mut unstructured = Unstructured::new(&buf);
20273 Self::arbitrary(&mut unstructured).unwrap_or_default()
20274 }
20275}
20276impl Default for MISSION_REQUEST_INT_DATA {
20277 fn default() -> Self {
20278 Self::DEFAULT.clone()
20279 }
20280}
20281impl MessageData for MISSION_REQUEST_INT_DATA {
20282 type Message = MavMessage;
20283 const ID: u32 = 51u32;
20284 const NAME: &'static str = "MISSION_REQUEST_INT";
20285 const EXTRA_CRC: u8 = 196u8;
20286 const ENCODED_LEN: usize = 5usize;
20287 fn deser(
20288 _version: MavlinkVersion,
20289 __input: &[u8],
20290 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20291 let avail_len = __input.len();
20292 let mut payload_buf = [0; Self::ENCODED_LEN];
20293 let mut buf = if avail_len < Self::ENCODED_LEN {
20294 payload_buf[0..avail_len].copy_from_slice(__input);
20295 Bytes::new(&payload_buf)
20296 } else {
20297 Bytes::new(__input)
20298 };
20299 let mut __struct = Self::default();
20300 __struct.seq = buf.get_u16_le()?;
20301 __struct.target_system = buf.get_u8()?;
20302 __struct.target_component = buf.get_u8()?;
20303 let tmp = buf.get_u8()?;
20304 __struct.mission_type =
20305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20306 enum_type: "MavMissionType",
20307 value: tmp as u64,
20308 })?;
20309 Ok(__struct)
20310 }
20311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20312 let mut __tmp = BytesMut::new(bytes);
20313 #[allow(clippy::absurd_extreme_comparisons)]
20314 #[allow(unused_comparisons)]
20315 if __tmp.remaining() < Self::ENCODED_LEN {
20316 panic!(
20317 "buffer is too small (need {} bytes, but got {})",
20318 Self::ENCODED_LEN,
20319 __tmp.remaining(),
20320 )
20321 }
20322 __tmp.put_u16_le(self.seq);
20323 __tmp.put_u8(self.target_system);
20324 __tmp.put_u8(self.target_component);
20325 if matches!(version, MavlinkVersion::V2) {
20326 __tmp.put_u8(self.mission_type as u8);
20327 let len = __tmp.len();
20328 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20329 } else {
20330 __tmp.len()
20331 }
20332 }
20333}
20334#[doc = "Request the overall list of mission items from the system/component."]
20335#[doc = ""]
20336#[doc = "ID: 43"]
20337#[derive(Debug, Clone, PartialEq)]
20338#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20340#[cfg_attr(feature = "ts", derive(TS))]
20341#[cfg_attr(feature = "ts", ts(export))]
20342pub struct MISSION_REQUEST_LIST_DATA {
20343 #[doc = "System ID"]
20344 pub target_system: u8,
20345 #[doc = "Component ID"]
20346 pub target_component: u8,
20347 #[doc = "Mission type."]
20348 #[cfg_attr(feature = "serde", serde(default))]
20349 pub mission_type: MavMissionType,
20350}
20351impl MISSION_REQUEST_LIST_DATA {
20352 pub const ENCODED_LEN: usize = 3usize;
20353 pub const DEFAULT: Self = Self {
20354 target_system: 0_u8,
20355 target_component: 0_u8,
20356 mission_type: MavMissionType::DEFAULT,
20357 };
20358 #[cfg(feature = "arbitrary")]
20359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20360 use arbitrary::{Arbitrary, Unstructured};
20361 let mut buf = [0u8; 1024];
20362 rng.fill_bytes(&mut buf);
20363 let mut unstructured = Unstructured::new(&buf);
20364 Self::arbitrary(&mut unstructured).unwrap_or_default()
20365 }
20366}
20367impl Default for MISSION_REQUEST_LIST_DATA {
20368 fn default() -> Self {
20369 Self::DEFAULT.clone()
20370 }
20371}
20372impl MessageData for MISSION_REQUEST_LIST_DATA {
20373 type Message = MavMessage;
20374 const ID: u32 = 43u32;
20375 const NAME: &'static str = "MISSION_REQUEST_LIST";
20376 const EXTRA_CRC: u8 = 132u8;
20377 const ENCODED_LEN: usize = 3usize;
20378 fn deser(
20379 _version: MavlinkVersion,
20380 __input: &[u8],
20381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20382 let avail_len = __input.len();
20383 let mut payload_buf = [0; Self::ENCODED_LEN];
20384 let mut buf = if avail_len < Self::ENCODED_LEN {
20385 payload_buf[0..avail_len].copy_from_slice(__input);
20386 Bytes::new(&payload_buf)
20387 } else {
20388 Bytes::new(__input)
20389 };
20390 let mut __struct = Self::default();
20391 __struct.target_system = buf.get_u8()?;
20392 __struct.target_component = buf.get_u8()?;
20393 let tmp = buf.get_u8()?;
20394 __struct.mission_type =
20395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20396 enum_type: "MavMissionType",
20397 value: tmp as u64,
20398 })?;
20399 Ok(__struct)
20400 }
20401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20402 let mut __tmp = BytesMut::new(bytes);
20403 #[allow(clippy::absurd_extreme_comparisons)]
20404 #[allow(unused_comparisons)]
20405 if __tmp.remaining() < Self::ENCODED_LEN {
20406 panic!(
20407 "buffer is too small (need {} bytes, but got {})",
20408 Self::ENCODED_LEN,
20409 __tmp.remaining(),
20410 )
20411 }
20412 __tmp.put_u8(self.target_system);
20413 __tmp.put_u8(self.target_component);
20414 if matches!(version, MavlinkVersion::V2) {
20415 __tmp.put_u8(self.mission_type as u8);
20416 let len = __tmp.len();
20417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20418 } else {
20419 __tmp.len()
20420 }
20421 }
20422}
20423#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20424#[doc = ""]
20425#[doc = "ID: 37"]
20426#[derive(Debug, Clone, PartialEq)]
20427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20429#[cfg_attr(feature = "ts", derive(TS))]
20430#[cfg_attr(feature = "ts", ts(export))]
20431pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20432 #[doc = "Start index"]
20433 pub start_index: i16,
20434 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20435 pub end_index: i16,
20436 #[doc = "System ID"]
20437 pub target_system: u8,
20438 #[doc = "Component ID"]
20439 pub target_component: u8,
20440 #[doc = "Mission type."]
20441 #[cfg_attr(feature = "serde", serde(default))]
20442 pub mission_type: MavMissionType,
20443}
20444impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20445 pub const ENCODED_LEN: usize = 7usize;
20446 pub const DEFAULT: Self = Self {
20447 start_index: 0_i16,
20448 end_index: 0_i16,
20449 target_system: 0_u8,
20450 target_component: 0_u8,
20451 mission_type: MavMissionType::DEFAULT,
20452 };
20453 #[cfg(feature = "arbitrary")]
20454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20455 use arbitrary::{Arbitrary, Unstructured};
20456 let mut buf = [0u8; 1024];
20457 rng.fill_bytes(&mut buf);
20458 let mut unstructured = Unstructured::new(&buf);
20459 Self::arbitrary(&mut unstructured).unwrap_or_default()
20460 }
20461}
20462impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20463 fn default() -> Self {
20464 Self::DEFAULT.clone()
20465 }
20466}
20467impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20468 type Message = MavMessage;
20469 const ID: u32 = 37u32;
20470 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20471 const EXTRA_CRC: u8 = 212u8;
20472 const ENCODED_LEN: usize = 7usize;
20473 fn deser(
20474 _version: MavlinkVersion,
20475 __input: &[u8],
20476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20477 let avail_len = __input.len();
20478 let mut payload_buf = [0; Self::ENCODED_LEN];
20479 let mut buf = if avail_len < Self::ENCODED_LEN {
20480 payload_buf[0..avail_len].copy_from_slice(__input);
20481 Bytes::new(&payload_buf)
20482 } else {
20483 Bytes::new(__input)
20484 };
20485 let mut __struct = Self::default();
20486 __struct.start_index = buf.get_i16_le()?;
20487 __struct.end_index = buf.get_i16_le()?;
20488 __struct.target_system = buf.get_u8()?;
20489 __struct.target_component = buf.get_u8()?;
20490 let tmp = buf.get_u8()?;
20491 __struct.mission_type =
20492 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20493 enum_type: "MavMissionType",
20494 value: tmp as u64,
20495 })?;
20496 Ok(__struct)
20497 }
20498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20499 let mut __tmp = BytesMut::new(bytes);
20500 #[allow(clippy::absurd_extreme_comparisons)]
20501 #[allow(unused_comparisons)]
20502 if __tmp.remaining() < Self::ENCODED_LEN {
20503 panic!(
20504 "buffer is too small (need {} bytes, but got {})",
20505 Self::ENCODED_LEN,
20506 __tmp.remaining(),
20507 )
20508 }
20509 __tmp.put_i16_le(self.start_index);
20510 __tmp.put_i16_le(self.end_index);
20511 __tmp.put_u8(self.target_system);
20512 __tmp.put_u8(self.target_component);
20513 if matches!(version, MavlinkVersion::V2) {
20514 __tmp.put_u8(self.mission_type as u8);
20515 let len = __tmp.len();
20516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20517 } else {
20518 __tmp.len()
20519 }
20520 }
20521}
20522#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20523#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20524#[doc = ""]
20525#[doc = "ID: 41"]
20526#[derive(Debug, Clone, PartialEq)]
20527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20529#[cfg_attr(feature = "ts", derive(TS))]
20530#[cfg_attr(feature = "ts", ts(export))]
20531pub struct MISSION_SET_CURRENT_DATA {
20532 #[doc = "Sequence"]
20533 pub seq: u16,
20534 #[doc = "System ID"]
20535 pub target_system: u8,
20536 #[doc = "Component ID"]
20537 pub target_component: u8,
20538}
20539impl MISSION_SET_CURRENT_DATA {
20540 pub const ENCODED_LEN: usize = 4usize;
20541 pub const DEFAULT: Self = Self {
20542 seq: 0_u16,
20543 target_system: 0_u8,
20544 target_component: 0_u8,
20545 };
20546 #[cfg(feature = "arbitrary")]
20547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20548 use arbitrary::{Arbitrary, Unstructured};
20549 let mut buf = [0u8; 1024];
20550 rng.fill_bytes(&mut buf);
20551 let mut unstructured = Unstructured::new(&buf);
20552 Self::arbitrary(&mut unstructured).unwrap_or_default()
20553 }
20554}
20555impl Default for MISSION_SET_CURRENT_DATA {
20556 fn default() -> Self {
20557 Self::DEFAULT.clone()
20558 }
20559}
20560impl MessageData for MISSION_SET_CURRENT_DATA {
20561 type Message = MavMessage;
20562 const ID: u32 = 41u32;
20563 const NAME: &'static str = "MISSION_SET_CURRENT";
20564 const EXTRA_CRC: u8 = 28u8;
20565 const ENCODED_LEN: usize = 4usize;
20566 fn deser(
20567 _version: MavlinkVersion,
20568 __input: &[u8],
20569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20570 let avail_len = __input.len();
20571 let mut payload_buf = [0; Self::ENCODED_LEN];
20572 let mut buf = if avail_len < Self::ENCODED_LEN {
20573 payload_buf[0..avail_len].copy_from_slice(__input);
20574 Bytes::new(&payload_buf)
20575 } else {
20576 Bytes::new(__input)
20577 };
20578 let mut __struct = Self::default();
20579 __struct.seq = buf.get_u16_le()?;
20580 __struct.target_system = buf.get_u8()?;
20581 __struct.target_component = buf.get_u8()?;
20582 Ok(__struct)
20583 }
20584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20585 let mut __tmp = BytesMut::new(bytes);
20586 #[allow(clippy::absurd_extreme_comparisons)]
20587 #[allow(unused_comparisons)]
20588 if __tmp.remaining() < Self::ENCODED_LEN {
20589 panic!(
20590 "buffer is too small (need {} bytes, but got {})",
20591 Self::ENCODED_LEN,
20592 __tmp.remaining(),
20593 )
20594 }
20595 __tmp.put_u16_le(self.seq);
20596 __tmp.put_u8(self.target_system);
20597 __tmp.put_u8(self.target_component);
20598 if matches!(version, MavlinkVersion::V2) {
20599 let len = __tmp.len();
20600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20601 } else {
20602 __tmp.len()
20603 }
20604 }
20605}
20606#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20607#[doc = ""]
20608#[doc = "ID: 38"]
20609#[derive(Debug, Clone, PartialEq)]
20610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20612#[cfg_attr(feature = "ts", derive(TS))]
20613#[cfg_attr(feature = "ts", ts(export))]
20614pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20615 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20616 pub start_index: i16,
20617 #[doc = "End index, equal or greater than start index."]
20618 pub end_index: i16,
20619 #[doc = "System ID"]
20620 pub target_system: u8,
20621 #[doc = "Component ID"]
20622 pub target_component: u8,
20623 #[doc = "Mission type."]
20624 #[cfg_attr(feature = "serde", serde(default))]
20625 pub mission_type: MavMissionType,
20626}
20627impl MISSION_WRITE_PARTIAL_LIST_DATA {
20628 pub const ENCODED_LEN: usize = 7usize;
20629 pub const DEFAULT: Self = Self {
20630 start_index: 0_i16,
20631 end_index: 0_i16,
20632 target_system: 0_u8,
20633 target_component: 0_u8,
20634 mission_type: MavMissionType::DEFAULT,
20635 };
20636 #[cfg(feature = "arbitrary")]
20637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20638 use arbitrary::{Arbitrary, Unstructured};
20639 let mut buf = [0u8; 1024];
20640 rng.fill_bytes(&mut buf);
20641 let mut unstructured = Unstructured::new(&buf);
20642 Self::arbitrary(&mut unstructured).unwrap_or_default()
20643 }
20644}
20645impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20646 fn default() -> Self {
20647 Self::DEFAULT.clone()
20648 }
20649}
20650impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20651 type Message = MavMessage;
20652 const ID: u32 = 38u32;
20653 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20654 const EXTRA_CRC: u8 = 9u8;
20655 const ENCODED_LEN: usize = 7usize;
20656 fn deser(
20657 _version: MavlinkVersion,
20658 __input: &[u8],
20659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20660 let avail_len = __input.len();
20661 let mut payload_buf = [0; Self::ENCODED_LEN];
20662 let mut buf = if avail_len < Self::ENCODED_LEN {
20663 payload_buf[0..avail_len].copy_from_slice(__input);
20664 Bytes::new(&payload_buf)
20665 } else {
20666 Bytes::new(__input)
20667 };
20668 let mut __struct = Self::default();
20669 __struct.start_index = buf.get_i16_le()?;
20670 __struct.end_index = buf.get_i16_le()?;
20671 __struct.target_system = buf.get_u8()?;
20672 __struct.target_component = buf.get_u8()?;
20673 let tmp = buf.get_u8()?;
20674 __struct.mission_type =
20675 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20676 enum_type: "MavMissionType",
20677 value: tmp as u64,
20678 })?;
20679 Ok(__struct)
20680 }
20681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20682 let mut __tmp = BytesMut::new(bytes);
20683 #[allow(clippy::absurd_extreme_comparisons)]
20684 #[allow(unused_comparisons)]
20685 if __tmp.remaining() < Self::ENCODED_LEN {
20686 panic!(
20687 "buffer is too small (need {} bytes, but got {})",
20688 Self::ENCODED_LEN,
20689 __tmp.remaining(),
20690 )
20691 }
20692 __tmp.put_i16_le(self.start_index);
20693 __tmp.put_i16_le(self.end_index);
20694 __tmp.put_u8(self.target_system);
20695 __tmp.put_u8(self.target_component);
20696 if matches!(version, MavlinkVersion::V2) {
20697 __tmp.put_u8(self.mission_type as u8);
20698 let len = __tmp.len();
20699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20700 } else {
20701 __tmp.len()
20702 }
20703 }
20704}
20705#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20706#[doc = "Orientation of a mount."]
20707#[doc = ""]
20708#[doc = "ID: 265"]
20709#[derive(Debug, Clone, PartialEq)]
20710#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20712#[cfg_attr(feature = "ts", derive(TS))]
20713#[cfg_attr(feature = "ts", ts(export))]
20714pub struct MOUNT_ORIENTATION_DATA {
20715 #[doc = "Timestamp (time since system boot)."]
20716 pub time_boot_ms: u32,
20717 #[doc = "Roll in global frame (set to NaN for invalid)."]
20718 pub roll: f32,
20719 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20720 pub pitch: f32,
20721 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20722 pub yaw: f32,
20723 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20725 pub yaw_absolute: f32,
20726}
20727impl MOUNT_ORIENTATION_DATA {
20728 pub const ENCODED_LEN: usize = 20usize;
20729 pub const DEFAULT: Self = Self {
20730 time_boot_ms: 0_u32,
20731 roll: 0.0_f32,
20732 pitch: 0.0_f32,
20733 yaw: 0.0_f32,
20734 yaw_absolute: 0.0_f32,
20735 };
20736 #[cfg(feature = "arbitrary")]
20737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20738 use arbitrary::{Arbitrary, Unstructured};
20739 let mut buf = [0u8; 1024];
20740 rng.fill_bytes(&mut buf);
20741 let mut unstructured = Unstructured::new(&buf);
20742 Self::arbitrary(&mut unstructured).unwrap_or_default()
20743 }
20744}
20745impl Default for MOUNT_ORIENTATION_DATA {
20746 fn default() -> Self {
20747 Self::DEFAULT.clone()
20748 }
20749}
20750impl MessageData for MOUNT_ORIENTATION_DATA {
20751 type Message = MavMessage;
20752 const ID: u32 = 265u32;
20753 const NAME: &'static str = "MOUNT_ORIENTATION";
20754 const EXTRA_CRC: u8 = 26u8;
20755 const ENCODED_LEN: usize = 20usize;
20756 fn deser(
20757 _version: MavlinkVersion,
20758 __input: &[u8],
20759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20760 let avail_len = __input.len();
20761 let mut payload_buf = [0; Self::ENCODED_LEN];
20762 let mut buf = if avail_len < Self::ENCODED_LEN {
20763 payload_buf[0..avail_len].copy_from_slice(__input);
20764 Bytes::new(&payload_buf)
20765 } else {
20766 Bytes::new(__input)
20767 };
20768 let mut __struct = Self::default();
20769 __struct.time_boot_ms = buf.get_u32_le()?;
20770 __struct.roll = buf.get_f32_le()?;
20771 __struct.pitch = buf.get_f32_le()?;
20772 __struct.yaw = buf.get_f32_le()?;
20773 __struct.yaw_absolute = buf.get_f32_le()?;
20774 Ok(__struct)
20775 }
20776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20777 let mut __tmp = BytesMut::new(bytes);
20778 #[allow(clippy::absurd_extreme_comparisons)]
20779 #[allow(unused_comparisons)]
20780 if __tmp.remaining() < Self::ENCODED_LEN {
20781 panic!(
20782 "buffer is too small (need {} bytes, but got {})",
20783 Self::ENCODED_LEN,
20784 __tmp.remaining(),
20785 )
20786 }
20787 __tmp.put_u32_le(self.time_boot_ms);
20788 __tmp.put_f32_le(self.roll);
20789 __tmp.put_f32_le(self.pitch);
20790 __tmp.put_f32_le(self.yaw);
20791 if matches!(version, MavlinkVersion::V2) {
20792 __tmp.put_f32_le(self.yaw_absolute);
20793 let len = __tmp.len();
20794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20795 } else {
20796 __tmp.len()
20797 }
20798 }
20799}
20800#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20801#[doc = ""]
20802#[doc = "ID: 251"]
20803#[derive(Debug, Clone, PartialEq)]
20804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20806#[cfg_attr(feature = "ts", derive(TS))]
20807#[cfg_attr(feature = "ts", ts(export))]
20808pub struct NAMED_VALUE_FLOAT_DATA {
20809 #[doc = "Timestamp (time since system boot)."]
20810 pub time_boot_ms: u32,
20811 #[doc = "Floating point value"]
20812 pub value: f32,
20813 #[doc = "Name of the debug variable"]
20814 #[cfg_attr(feature = "ts", ts(type = "string"))]
20815 pub name: CharArray<10>,
20816}
20817impl NAMED_VALUE_FLOAT_DATA {
20818 pub const ENCODED_LEN: usize = 18usize;
20819 pub const DEFAULT: Self = Self {
20820 time_boot_ms: 0_u32,
20821 value: 0.0_f32,
20822 name: CharArray::new([0_u8; 10usize]),
20823 };
20824 #[cfg(feature = "arbitrary")]
20825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20826 use arbitrary::{Arbitrary, Unstructured};
20827 let mut buf = [0u8; 1024];
20828 rng.fill_bytes(&mut buf);
20829 let mut unstructured = Unstructured::new(&buf);
20830 Self::arbitrary(&mut unstructured).unwrap_or_default()
20831 }
20832}
20833impl Default for NAMED_VALUE_FLOAT_DATA {
20834 fn default() -> Self {
20835 Self::DEFAULT.clone()
20836 }
20837}
20838impl MessageData for NAMED_VALUE_FLOAT_DATA {
20839 type Message = MavMessage;
20840 const ID: u32 = 251u32;
20841 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20842 const EXTRA_CRC: u8 = 170u8;
20843 const ENCODED_LEN: usize = 18usize;
20844 fn deser(
20845 _version: MavlinkVersion,
20846 __input: &[u8],
20847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20848 let avail_len = __input.len();
20849 let mut payload_buf = [0; Self::ENCODED_LEN];
20850 let mut buf = if avail_len < Self::ENCODED_LEN {
20851 payload_buf[0..avail_len].copy_from_slice(__input);
20852 Bytes::new(&payload_buf)
20853 } else {
20854 Bytes::new(__input)
20855 };
20856 let mut __struct = Self::default();
20857 __struct.time_boot_ms = buf.get_u32_le()?;
20858 __struct.value = buf.get_f32_le()?;
20859 let mut tmp = [0_u8; 10usize];
20860 for v in &mut tmp {
20861 *v = buf.get_u8()?;
20862 }
20863 __struct.name = CharArray::new(tmp);
20864 Ok(__struct)
20865 }
20866 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20867 let mut __tmp = BytesMut::new(bytes);
20868 #[allow(clippy::absurd_extreme_comparisons)]
20869 #[allow(unused_comparisons)]
20870 if __tmp.remaining() < Self::ENCODED_LEN {
20871 panic!(
20872 "buffer is too small (need {} bytes, but got {})",
20873 Self::ENCODED_LEN,
20874 __tmp.remaining(),
20875 )
20876 }
20877 __tmp.put_u32_le(self.time_boot_ms);
20878 __tmp.put_f32_le(self.value);
20879 for val in &self.name {
20880 __tmp.put_u8(*val);
20881 }
20882 if matches!(version, MavlinkVersion::V2) {
20883 let len = __tmp.len();
20884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20885 } else {
20886 __tmp.len()
20887 }
20888 }
20889}
20890#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20891#[doc = ""]
20892#[doc = "ID: 252"]
20893#[derive(Debug, Clone, PartialEq)]
20894#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20896#[cfg_attr(feature = "ts", derive(TS))]
20897#[cfg_attr(feature = "ts", ts(export))]
20898pub struct NAMED_VALUE_INT_DATA {
20899 #[doc = "Timestamp (time since system boot)."]
20900 pub time_boot_ms: u32,
20901 #[doc = "Signed integer value"]
20902 pub value: i32,
20903 #[doc = "Name of the debug variable"]
20904 #[cfg_attr(feature = "ts", ts(type = "string"))]
20905 pub name: CharArray<10>,
20906}
20907impl NAMED_VALUE_INT_DATA {
20908 pub const ENCODED_LEN: usize = 18usize;
20909 pub const DEFAULT: Self = Self {
20910 time_boot_ms: 0_u32,
20911 value: 0_i32,
20912 name: CharArray::new([0_u8; 10usize]),
20913 };
20914 #[cfg(feature = "arbitrary")]
20915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20916 use arbitrary::{Arbitrary, Unstructured};
20917 let mut buf = [0u8; 1024];
20918 rng.fill_bytes(&mut buf);
20919 let mut unstructured = Unstructured::new(&buf);
20920 Self::arbitrary(&mut unstructured).unwrap_or_default()
20921 }
20922}
20923impl Default for NAMED_VALUE_INT_DATA {
20924 fn default() -> Self {
20925 Self::DEFAULT.clone()
20926 }
20927}
20928impl MessageData for NAMED_VALUE_INT_DATA {
20929 type Message = MavMessage;
20930 const ID: u32 = 252u32;
20931 const NAME: &'static str = "NAMED_VALUE_INT";
20932 const EXTRA_CRC: u8 = 44u8;
20933 const ENCODED_LEN: usize = 18usize;
20934 fn deser(
20935 _version: MavlinkVersion,
20936 __input: &[u8],
20937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20938 let avail_len = __input.len();
20939 let mut payload_buf = [0; Self::ENCODED_LEN];
20940 let mut buf = if avail_len < Self::ENCODED_LEN {
20941 payload_buf[0..avail_len].copy_from_slice(__input);
20942 Bytes::new(&payload_buf)
20943 } else {
20944 Bytes::new(__input)
20945 };
20946 let mut __struct = Self::default();
20947 __struct.time_boot_ms = buf.get_u32_le()?;
20948 __struct.value = buf.get_i32_le()?;
20949 let mut tmp = [0_u8; 10usize];
20950 for v in &mut tmp {
20951 *v = buf.get_u8()?;
20952 }
20953 __struct.name = CharArray::new(tmp);
20954 Ok(__struct)
20955 }
20956 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20957 let mut __tmp = BytesMut::new(bytes);
20958 #[allow(clippy::absurd_extreme_comparisons)]
20959 #[allow(unused_comparisons)]
20960 if __tmp.remaining() < Self::ENCODED_LEN {
20961 panic!(
20962 "buffer is too small (need {} bytes, but got {})",
20963 Self::ENCODED_LEN,
20964 __tmp.remaining(),
20965 )
20966 }
20967 __tmp.put_u32_le(self.time_boot_ms);
20968 __tmp.put_i32_le(self.value);
20969 for val in &self.name {
20970 __tmp.put_u8(*val);
20971 }
20972 if matches!(version, MavlinkVersion::V2) {
20973 let len = __tmp.len();
20974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20975 } else {
20976 __tmp.len()
20977 }
20978 }
20979}
20980#[doc = "The state of the navigation and position controller."]
20981#[doc = ""]
20982#[doc = "ID: 62"]
20983#[derive(Debug, Clone, PartialEq)]
20984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20986#[cfg_attr(feature = "ts", derive(TS))]
20987#[cfg_attr(feature = "ts", ts(export))]
20988pub struct NAV_CONTROLLER_OUTPUT_DATA {
20989 #[doc = "Current desired roll"]
20990 pub nav_roll: f32,
20991 #[doc = "Current desired pitch"]
20992 pub nav_pitch: f32,
20993 #[doc = "Current altitude error"]
20994 pub alt_error: f32,
20995 #[doc = "Current airspeed error"]
20996 pub aspd_error: f32,
20997 #[doc = "Current crosstrack error on x-y plane"]
20998 pub xtrack_error: f32,
20999 #[doc = "Current desired heading"]
21000 pub nav_bearing: i16,
21001 #[doc = "Bearing to current waypoint/target"]
21002 pub target_bearing: i16,
21003 #[doc = "Distance to active waypoint"]
21004 pub wp_dist: u16,
21005}
21006impl NAV_CONTROLLER_OUTPUT_DATA {
21007 pub const ENCODED_LEN: usize = 26usize;
21008 pub const DEFAULT: Self = Self {
21009 nav_roll: 0.0_f32,
21010 nav_pitch: 0.0_f32,
21011 alt_error: 0.0_f32,
21012 aspd_error: 0.0_f32,
21013 xtrack_error: 0.0_f32,
21014 nav_bearing: 0_i16,
21015 target_bearing: 0_i16,
21016 wp_dist: 0_u16,
21017 };
21018 #[cfg(feature = "arbitrary")]
21019 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21020 use arbitrary::{Arbitrary, Unstructured};
21021 let mut buf = [0u8; 1024];
21022 rng.fill_bytes(&mut buf);
21023 let mut unstructured = Unstructured::new(&buf);
21024 Self::arbitrary(&mut unstructured).unwrap_or_default()
21025 }
21026}
21027impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21028 fn default() -> Self {
21029 Self::DEFAULT.clone()
21030 }
21031}
21032impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21033 type Message = MavMessage;
21034 const ID: u32 = 62u32;
21035 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21036 const EXTRA_CRC: u8 = 183u8;
21037 const ENCODED_LEN: usize = 26usize;
21038 fn deser(
21039 _version: MavlinkVersion,
21040 __input: &[u8],
21041 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21042 let avail_len = __input.len();
21043 let mut payload_buf = [0; Self::ENCODED_LEN];
21044 let mut buf = if avail_len < Self::ENCODED_LEN {
21045 payload_buf[0..avail_len].copy_from_slice(__input);
21046 Bytes::new(&payload_buf)
21047 } else {
21048 Bytes::new(__input)
21049 };
21050 let mut __struct = Self::default();
21051 __struct.nav_roll = buf.get_f32_le()?;
21052 __struct.nav_pitch = buf.get_f32_le()?;
21053 __struct.alt_error = buf.get_f32_le()?;
21054 __struct.aspd_error = buf.get_f32_le()?;
21055 __struct.xtrack_error = buf.get_f32_le()?;
21056 __struct.nav_bearing = buf.get_i16_le()?;
21057 __struct.target_bearing = buf.get_i16_le()?;
21058 __struct.wp_dist = buf.get_u16_le()?;
21059 Ok(__struct)
21060 }
21061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21062 let mut __tmp = BytesMut::new(bytes);
21063 #[allow(clippy::absurd_extreme_comparisons)]
21064 #[allow(unused_comparisons)]
21065 if __tmp.remaining() < Self::ENCODED_LEN {
21066 panic!(
21067 "buffer is too small (need {} bytes, but got {})",
21068 Self::ENCODED_LEN,
21069 __tmp.remaining(),
21070 )
21071 }
21072 __tmp.put_f32_le(self.nav_roll);
21073 __tmp.put_f32_le(self.nav_pitch);
21074 __tmp.put_f32_le(self.alt_error);
21075 __tmp.put_f32_le(self.aspd_error);
21076 __tmp.put_f32_le(self.xtrack_error);
21077 __tmp.put_i16_le(self.nav_bearing);
21078 __tmp.put_i16_le(self.target_bearing);
21079 __tmp.put_u16_le(self.wp_dist);
21080 if matches!(version, MavlinkVersion::V2) {
21081 let len = __tmp.len();
21082 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21083 } else {
21084 __tmp.len()
21085 }
21086 }
21087}
21088#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21089#[doc = ""]
21090#[doc = "ID: 330"]
21091#[derive(Debug, Clone, PartialEq)]
21092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21094#[cfg_attr(feature = "ts", derive(TS))]
21095#[cfg_attr(feature = "ts", ts(export))]
21096pub struct OBSTACLE_DISTANCE_DATA {
21097 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21098 pub time_usec: u64,
21099 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21100 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21101 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21102 pub distances: [u16; 72],
21103 #[doc = "Minimum distance the sensor can measure."]
21104 pub min_distance: u16,
21105 #[doc = "Maximum distance the sensor can measure."]
21106 pub max_distance: u16,
21107 #[doc = "Class id of the distance sensor type."]
21108 pub sensor_type: MavDistanceSensor,
21109 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21110 pub increment: u8,
21111 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21112 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21113 pub increment_f: f32,
21114 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21115 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21116 pub angle_offset: f32,
21117 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21118 #[cfg_attr(feature = "serde", serde(default))]
21119 pub frame: MavFrame,
21120}
21121impl OBSTACLE_DISTANCE_DATA {
21122 pub const ENCODED_LEN: usize = 167usize;
21123 pub const DEFAULT: Self = Self {
21124 time_usec: 0_u64,
21125 distances: [0_u16; 72usize],
21126 min_distance: 0_u16,
21127 max_distance: 0_u16,
21128 sensor_type: MavDistanceSensor::DEFAULT,
21129 increment: 0_u8,
21130 increment_f: 0.0_f32,
21131 angle_offset: 0.0_f32,
21132 frame: MavFrame::DEFAULT,
21133 };
21134 #[cfg(feature = "arbitrary")]
21135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21136 use arbitrary::{Arbitrary, Unstructured};
21137 let mut buf = [0u8; 1024];
21138 rng.fill_bytes(&mut buf);
21139 let mut unstructured = Unstructured::new(&buf);
21140 Self::arbitrary(&mut unstructured).unwrap_or_default()
21141 }
21142}
21143impl Default for OBSTACLE_DISTANCE_DATA {
21144 fn default() -> Self {
21145 Self::DEFAULT.clone()
21146 }
21147}
21148impl MessageData for OBSTACLE_DISTANCE_DATA {
21149 type Message = MavMessage;
21150 const ID: u32 = 330u32;
21151 const NAME: &'static str = "OBSTACLE_DISTANCE";
21152 const EXTRA_CRC: u8 = 23u8;
21153 const ENCODED_LEN: usize = 167usize;
21154 fn deser(
21155 _version: MavlinkVersion,
21156 __input: &[u8],
21157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21158 let avail_len = __input.len();
21159 let mut payload_buf = [0; Self::ENCODED_LEN];
21160 let mut buf = if avail_len < Self::ENCODED_LEN {
21161 payload_buf[0..avail_len].copy_from_slice(__input);
21162 Bytes::new(&payload_buf)
21163 } else {
21164 Bytes::new(__input)
21165 };
21166 let mut __struct = Self::default();
21167 __struct.time_usec = buf.get_u64_le()?;
21168 for v in &mut __struct.distances {
21169 let val = buf.get_u16_le()?;
21170 *v = val;
21171 }
21172 __struct.min_distance = buf.get_u16_le()?;
21173 __struct.max_distance = buf.get_u16_le()?;
21174 let tmp = buf.get_u8()?;
21175 __struct.sensor_type =
21176 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21177 enum_type: "MavDistanceSensor",
21178 value: tmp as u64,
21179 })?;
21180 __struct.increment = buf.get_u8()?;
21181 __struct.increment_f = buf.get_f32_le()?;
21182 __struct.angle_offset = buf.get_f32_le()?;
21183 let tmp = buf.get_u8()?;
21184 __struct.frame =
21185 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21186 enum_type: "MavFrame",
21187 value: tmp as u64,
21188 })?;
21189 Ok(__struct)
21190 }
21191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21192 let mut __tmp = BytesMut::new(bytes);
21193 #[allow(clippy::absurd_extreme_comparisons)]
21194 #[allow(unused_comparisons)]
21195 if __tmp.remaining() < Self::ENCODED_LEN {
21196 panic!(
21197 "buffer is too small (need {} bytes, but got {})",
21198 Self::ENCODED_LEN,
21199 __tmp.remaining(),
21200 )
21201 }
21202 __tmp.put_u64_le(self.time_usec);
21203 for val in &self.distances {
21204 __tmp.put_u16_le(*val);
21205 }
21206 __tmp.put_u16_le(self.min_distance);
21207 __tmp.put_u16_le(self.max_distance);
21208 __tmp.put_u8(self.sensor_type as u8);
21209 __tmp.put_u8(self.increment);
21210 if matches!(version, MavlinkVersion::V2) {
21211 __tmp.put_f32_le(self.increment_f);
21212 __tmp.put_f32_le(self.angle_offset);
21213 __tmp.put_u8(self.frame as u8);
21214 let len = __tmp.len();
21215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21216 } else {
21217 __tmp.len()
21218 }
21219 }
21220}
21221#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21222#[doc = ""]
21223#[doc = "ID: 331"]
21224#[derive(Debug, Clone, PartialEq)]
21225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21226#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21227#[cfg_attr(feature = "ts", derive(TS))]
21228#[cfg_attr(feature = "ts", ts(export))]
21229pub struct ODOMETRY_DATA {
21230 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21231 pub time_usec: u64,
21232 #[doc = "X Position"]
21233 pub x: f32,
21234 #[doc = "Y Position"]
21235 pub y: f32,
21236 #[doc = "Z Position"]
21237 pub z: f32,
21238 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21239 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21240 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21241 pub q: [f32; 4],
21242 #[doc = "X linear speed"]
21243 pub vx: f32,
21244 #[doc = "Y linear speed"]
21245 pub vy: f32,
21246 #[doc = "Z linear speed"]
21247 pub vz: f32,
21248 #[doc = "Roll angular speed"]
21249 pub rollspeed: f32,
21250 #[doc = "Pitch angular speed"]
21251 pub pitchspeed: f32,
21252 #[doc = "Yaw angular speed"]
21253 pub yawspeed: f32,
21254 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21255 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21256 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21257 pub pose_covariance: [f32; 21],
21258 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21260 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21261 pub velocity_covariance: [f32; 21],
21262 #[doc = "Coordinate frame of reference for the pose data."]
21263 pub frame_id: MavFrame,
21264 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21265 pub child_frame_id: MavFrame,
21266 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21267 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21268 pub reset_counter: u8,
21269 #[doc = "Type of estimator that is providing the odometry."]
21270 #[cfg_attr(feature = "serde", serde(default))]
21271 pub estimator_type: MavEstimatorType,
21272 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21273 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21274 pub quality: i8,
21275}
21276impl ODOMETRY_DATA {
21277 pub const ENCODED_LEN: usize = 233usize;
21278 pub const DEFAULT: Self = Self {
21279 time_usec: 0_u64,
21280 x: 0.0_f32,
21281 y: 0.0_f32,
21282 z: 0.0_f32,
21283 q: [0.0_f32; 4usize],
21284 vx: 0.0_f32,
21285 vy: 0.0_f32,
21286 vz: 0.0_f32,
21287 rollspeed: 0.0_f32,
21288 pitchspeed: 0.0_f32,
21289 yawspeed: 0.0_f32,
21290 pose_covariance: [0.0_f32; 21usize],
21291 velocity_covariance: [0.0_f32; 21usize],
21292 frame_id: MavFrame::DEFAULT,
21293 child_frame_id: MavFrame::DEFAULT,
21294 reset_counter: 0_u8,
21295 estimator_type: MavEstimatorType::DEFAULT,
21296 quality: 0_i8,
21297 };
21298 #[cfg(feature = "arbitrary")]
21299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21300 use arbitrary::{Arbitrary, Unstructured};
21301 let mut buf = [0u8; 1024];
21302 rng.fill_bytes(&mut buf);
21303 let mut unstructured = Unstructured::new(&buf);
21304 Self::arbitrary(&mut unstructured).unwrap_or_default()
21305 }
21306}
21307impl Default for ODOMETRY_DATA {
21308 fn default() -> Self {
21309 Self::DEFAULT.clone()
21310 }
21311}
21312impl MessageData for ODOMETRY_DATA {
21313 type Message = MavMessage;
21314 const ID: u32 = 331u32;
21315 const NAME: &'static str = "ODOMETRY";
21316 const EXTRA_CRC: u8 = 91u8;
21317 const ENCODED_LEN: usize = 233usize;
21318 fn deser(
21319 _version: MavlinkVersion,
21320 __input: &[u8],
21321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21322 let avail_len = __input.len();
21323 let mut payload_buf = [0; Self::ENCODED_LEN];
21324 let mut buf = if avail_len < Self::ENCODED_LEN {
21325 payload_buf[0..avail_len].copy_from_slice(__input);
21326 Bytes::new(&payload_buf)
21327 } else {
21328 Bytes::new(__input)
21329 };
21330 let mut __struct = Self::default();
21331 __struct.time_usec = buf.get_u64_le()?;
21332 __struct.x = buf.get_f32_le()?;
21333 __struct.y = buf.get_f32_le()?;
21334 __struct.z = buf.get_f32_le()?;
21335 for v in &mut __struct.q {
21336 let val = buf.get_f32_le()?;
21337 *v = val;
21338 }
21339 __struct.vx = buf.get_f32_le()?;
21340 __struct.vy = buf.get_f32_le()?;
21341 __struct.vz = buf.get_f32_le()?;
21342 __struct.rollspeed = buf.get_f32_le()?;
21343 __struct.pitchspeed = buf.get_f32_le()?;
21344 __struct.yawspeed = buf.get_f32_le()?;
21345 for v in &mut __struct.pose_covariance {
21346 let val = buf.get_f32_le()?;
21347 *v = val;
21348 }
21349 for v in &mut __struct.velocity_covariance {
21350 let val = buf.get_f32_le()?;
21351 *v = val;
21352 }
21353 let tmp = buf.get_u8()?;
21354 __struct.frame_id =
21355 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21356 enum_type: "MavFrame",
21357 value: tmp as u64,
21358 })?;
21359 let tmp = buf.get_u8()?;
21360 __struct.child_frame_id =
21361 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21362 enum_type: "MavFrame",
21363 value: tmp as u64,
21364 })?;
21365 __struct.reset_counter = buf.get_u8()?;
21366 let tmp = buf.get_u8()?;
21367 __struct.estimator_type =
21368 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21369 enum_type: "MavEstimatorType",
21370 value: tmp as u64,
21371 })?;
21372 __struct.quality = buf.get_i8()?;
21373 Ok(__struct)
21374 }
21375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21376 let mut __tmp = BytesMut::new(bytes);
21377 #[allow(clippy::absurd_extreme_comparisons)]
21378 #[allow(unused_comparisons)]
21379 if __tmp.remaining() < Self::ENCODED_LEN {
21380 panic!(
21381 "buffer is too small (need {} bytes, but got {})",
21382 Self::ENCODED_LEN,
21383 __tmp.remaining(),
21384 )
21385 }
21386 __tmp.put_u64_le(self.time_usec);
21387 __tmp.put_f32_le(self.x);
21388 __tmp.put_f32_le(self.y);
21389 __tmp.put_f32_le(self.z);
21390 for val in &self.q {
21391 __tmp.put_f32_le(*val);
21392 }
21393 __tmp.put_f32_le(self.vx);
21394 __tmp.put_f32_le(self.vy);
21395 __tmp.put_f32_le(self.vz);
21396 __tmp.put_f32_le(self.rollspeed);
21397 __tmp.put_f32_le(self.pitchspeed);
21398 __tmp.put_f32_le(self.yawspeed);
21399 for val in &self.pose_covariance {
21400 __tmp.put_f32_le(*val);
21401 }
21402 for val in &self.velocity_covariance {
21403 __tmp.put_f32_le(*val);
21404 }
21405 __tmp.put_u8(self.frame_id as u8);
21406 __tmp.put_u8(self.child_frame_id as u8);
21407 if matches!(version, MavlinkVersion::V2) {
21408 __tmp.put_u8(self.reset_counter);
21409 __tmp.put_u8(self.estimator_type as u8);
21410 __tmp.put_i8(self.quality);
21411 let len = __tmp.len();
21412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21413 } else {
21414 __tmp.len()
21415 }
21416 }
21417}
21418#[doc = "Hardware status sent by an onboard computer."]
21419#[doc = ""]
21420#[doc = "ID: 390"]
21421#[derive(Debug, Clone, PartialEq)]
21422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21424#[cfg_attr(feature = "ts", derive(TS))]
21425#[cfg_attr(feature = "ts", ts(export))]
21426pub struct ONBOARD_COMPUTER_STATUS_DATA {
21427 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21428 pub time_usec: u64,
21429 #[doc = "Time since system boot."]
21430 pub uptime: u32,
21431 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21432 pub ram_usage: u32,
21433 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21434 pub ram_total: u32,
21435 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21437 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21438 pub storage_type: [u32; 4],
21439 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21441 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21442 pub storage_usage: [u32; 4],
21443 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21446 pub storage_total: [u32; 4],
21447 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21448 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21449 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21450 pub link_type: [u32; 6],
21451 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21453 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21454 pub link_tx_rate: [u32; 6],
21455 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21456 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21457 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21458 pub link_rx_rate: [u32; 6],
21459 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21460 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21461 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21462 pub link_tx_max: [u32; 6],
21463 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21464 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21465 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21466 pub link_rx_max: [u32; 6],
21467 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21469 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21470 pub fan_speed: [i16; 4],
21471 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21472 pub mavtype: u8,
21473 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21474 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21475 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21476 pub cpu_cores: [u8; 8],
21477 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21478 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21479 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21480 pub cpu_combined: [u8; 10],
21481 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21482 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21483 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21484 pub gpu_cores: [u8; 4],
21485 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21487 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21488 pub gpu_combined: [u8; 10],
21489 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21490 pub temperature_board: i8,
21491 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21493 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21494 pub temperature_core: [i8; 8],
21495}
21496impl ONBOARD_COMPUTER_STATUS_DATA {
21497 pub const ENCODED_LEN: usize = 238usize;
21498 pub const DEFAULT: Self = Self {
21499 time_usec: 0_u64,
21500 uptime: 0_u32,
21501 ram_usage: 0_u32,
21502 ram_total: 0_u32,
21503 storage_type: [0_u32; 4usize],
21504 storage_usage: [0_u32; 4usize],
21505 storage_total: [0_u32; 4usize],
21506 link_type: [0_u32; 6usize],
21507 link_tx_rate: [0_u32; 6usize],
21508 link_rx_rate: [0_u32; 6usize],
21509 link_tx_max: [0_u32; 6usize],
21510 link_rx_max: [0_u32; 6usize],
21511 fan_speed: [0_i16; 4usize],
21512 mavtype: 0_u8,
21513 cpu_cores: [0_u8; 8usize],
21514 cpu_combined: [0_u8; 10usize],
21515 gpu_cores: [0_u8; 4usize],
21516 gpu_combined: [0_u8; 10usize],
21517 temperature_board: 0_i8,
21518 temperature_core: [0_i8; 8usize],
21519 };
21520 #[cfg(feature = "arbitrary")]
21521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21522 use arbitrary::{Arbitrary, Unstructured};
21523 let mut buf = [0u8; 1024];
21524 rng.fill_bytes(&mut buf);
21525 let mut unstructured = Unstructured::new(&buf);
21526 Self::arbitrary(&mut unstructured).unwrap_or_default()
21527 }
21528}
21529impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21530 fn default() -> Self {
21531 Self::DEFAULT.clone()
21532 }
21533}
21534impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21535 type Message = MavMessage;
21536 const ID: u32 = 390u32;
21537 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21538 const EXTRA_CRC: u8 = 156u8;
21539 const ENCODED_LEN: usize = 238usize;
21540 fn deser(
21541 _version: MavlinkVersion,
21542 __input: &[u8],
21543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21544 let avail_len = __input.len();
21545 let mut payload_buf = [0; Self::ENCODED_LEN];
21546 let mut buf = if avail_len < Self::ENCODED_LEN {
21547 payload_buf[0..avail_len].copy_from_slice(__input);
21548 Bytes::new(&payload_buf)
21549 } else {
21550 Bytes::new(__input)
21551 };
21552 let mut __struct = Self::default();
21553 __struct.time_usec = buf.get_u64_le()?;
21554 __struct.uptime = buf.get_u32_le()?;
21555 __struct.ram_usage = buf.get_u32_le()?;
21556 __struct.ram_total = buf.get_u32_le()?;
21557 for v in &mut __struct.storage_type {
21558 let val = buf.get_u32_le()?;
21559 *v = val;
21560 }
21561 for v in &mut __struct.storage_usage {
21562 let val = buf.get_u32_le()?;
21563 *v = val;
21564 }
21565 for v in &mut __struct.storage_total {
21566 let val = buf.get_u32_le()?;
21567 *v = val;
21568 }
21569 for v in &mut __struct.link_type {
21570 let val = buf.get_u32_le()?;
21571 *v = val;
21572 }
21573 for v in &mut __struct.link_tx_rate {
21574 let val = buf.get_u32_le()?;
21575 *v = val;
21576 }
21577 for v in &mut __struct.link_rx_rate {
21578 let val = buf.get_u32_le()?;
21579 *v = val;
21580 }
21581 for v in &mut __struct.link_tx_max {
21582 let val = buf.get_u32_le()?;
21583 *v = val;
21584 }
21585 for v in &mut __struct.link_rx_max {
21586 let val = buf.get_u32_le()?;
21587 *v = val;
21588 }
21589 for v in &mut __struct.fan_speed {
21590 let val = buf.get_i16_le()?;
21591 *v = val;
21592 }
21593 __struct.mavtype = buf.get_u8()?;
21594 for v in &mut __struct.cpu_cores {
21595 let val = buf.get_u8()?;
21596 *v = val;
21597 }
21598 for v in &mut __struct.cpu_combined {
21599 let val = buf.get_u8()?;
21600 *v = val;
21601 }
21602 for v in &mut __struct.gpu_cores {
21603 let val = buf.get_u8()?;
21604 *v = val;
21605 }
21606 for v in &mut __struct.gpu_combined {
21607 let val = buf.get_u8()?;
21608 *v = val;
21609 }
21610 __struct.temperature_board = buf.get_i8()?;
21611 for v in &mut __struct.temperature_core {
21612 let val = buf.get_i8()?;
21613 *v = val;
21614 }
21615 Ok(__struct)
21616 }
21617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21618 let mut __tmp = BytesMut::new(bytes);
21619 #[allow(clippy::absurd_extreme_comparisons)]
21620 #[allow(unused_comparisons)]
21621 if __tmp.remaining() < Self::ENCODED_LEN {
21622 panic!(
21623 "buffer is too small (need {} bytes, but got {})",
21624 Self::ENCODED_LEN,
21625 __tmp.remaining(),
21626 )
21627 }
21628 __tmp.put_u64_le(self.time_usec);
21629 __tmp.put_u32_le(self.uptime);
21630 __tmp.put_u32_le(self.ram_usage);
21631 __tmp.put_u32_le(self.ram_total);
21632 for val in &self.storage_type {
21633 __tmp.put_u32_le(*val);
21634 }
21635 for val in &self.storage_usage {
21636 __tmp.put_u32_le(*val);
21637 }
21638 for val in &self.storage_total {
21639 __tmp.put_u32_le(*val);
21640 }
21641 for val in &self.link_type {
21642 __tmp.put_u32_le(*val);
21643 }
21644 for val in &self.link_tx_rate {
21645 __tmp.put_u32_le(*val);
21646 }
21647 for val in &self.link_rx_rate {
21648 __tmp.put_u32_le(*val);
21649 }
21650 for val in &self.link_tx_max {
21651 __tmp.put_u32_le(*val);
21652 }
21653 for val in &self.link_rx_max {
21654 __tmp.put_u32_le(*val);
21655 }
21656 for val in &self.fan_speed {
21657 __tmp.put_i16_le(*val);
21658 }
21659 __tmp.put_u8(self.mavtype);
21660 for val in &self.cpu_cores {
21661 __tmp.put_u8(*val);
21662 }
21663 for val in &self.cpu_combined {
21664 __tmp.put_u8(*val);
21665 }
21666 for val in &self.gpu_cores {
21667 __tmp.put_u8(*val);
21668 }
21669 for val in &self.gpu_combined {
21670 __tmp.put_u8(*val);
21671 }
21672 __tmp.put_i8(self.temperature_board);
21673 for val in &self.temperature_core {
21674 __tmp.put_i8(*val);
21675 }
21676 if matches!(version, MavlinkVersion::V2) {
21677 let len = __tmp.len();
21678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21679 } else {
21680 __tmp.len()
21681 }
21682 }
21683}
21684#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21685#[doc = ""]
21686#[doc = "ID: 12918"]
21687#[derive(Debug, Clone, PartialEq)]
21688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21690#[cfg_attr(feature = "ts", derive(TS))]
21691#[cfg_attr(feature = "ts", ts(export))]
21692pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21693 #[doc = "Status level indicating if arming is allowed."]
21694 pub status: MavOdidArmStatus,
21695 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21696 #[cfg_attr(feature = "ts", ts(type = "string"))]
21697 pub error: CharArray<50>,
21698}
21699impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21700 pub const ENCODED_LEN: usize = 51usize;
21701 pub const DEFAULT: Self = Self {
21702 status: MavOdidArmStatus::DEFAULT,
21703 error: CharArray::new([0_u8; 50usize]),
21704 };
21705 #[cfg(feature = "arbitrary")]
21706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21707 use arbitrary::{Arbitrary, Unstructured};
21708 let mut buf = [0u8; 1024];
21709 rng.fill_bytes(&mut buf);
21710 let mut unstructured = Unstructured::new(&buf);
21711 Self::arbitrary(&mut unstructured).unwrap_or_default()
21712 }
21713}
21714impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21715 fn default() -> Self {
21716 Self::DEFAULT.clone()
21717 }
21718}
21719impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21720 type Message = MavMessage;
21721 const ID: u32 = 12918u32;
21722 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21723 const EXTRA_CRC: u8 = 139u8;
21724 const ENCODED_LEN: usize = 51usize;
21725 fn deser(
21726 _version: MavlinkVersion,
21727 __input: &[u8],
21728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21729 let avail_len = __input.len();
21730 let mut payload_buf = [0; Self::ENCODED_LEN];
21731 let mut buf = if avail_len < Self::ENCODED_LEN {
21732 payload_buf[0..avail_len].copy_from_slice(__input);
21733 Bytes::new(&payload_buf)
21734 } else {
21735 Bytes::new(__input)
21736 };
21737 let mut __struct = Self::default();
21738 let tmp = buf.get_u8()?;
21739 __struct.status =
21740 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21741 enum_type: "MavOdidArmStatus",
21742 value: tmp as u64,
21743 })?;
21744 let mut tmp = [0_u8; 50usize];
21745 for v in &mut tmp {
21746 *v = buf.get_u8()?;
21747 }
21748 __struct.error = CharArray::new(tmp);
21749 Ok(__struct)
21750 }
21751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21752 let mut __tmp = BytesMut::new(bytes);
21753 #[allow(clippy::absurd_extreme_comparisons)]
21754 #[allow(unused_comparisons)]
21755 if __tmp.remaining() < Self::ENCODED_LEN {
21756 panic!(
21757 "buffer is too small (need {} bytes, but got {})",
21758 Self::ENCODED_LEN,
21759 __tmp.remaining(),
21760 )
21761 }
21762 __tmp.put_u8(self.status as u8);
21763 for val in &self.error {
21764 __tmp.put_u8(*val);
21765 }
21766 if matches!(version, MavlinkVersion::V2) {
21767 let len = __tmp.len();
21768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21769 } else {
21770 __tmp.len()
21771 }
21772 }
21773}
21774#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21775#[doc = ""]
21776#[doc = "ID: 12902"]
21777#[derive(Debug, Clone, PartialEq)]
21778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21780#[cfg_attr(feature = "ts", derive(TS))]
21781#[cfg_attr(feature = "ts", ts(export))]
21782pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21783 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21784 pub timestamp: u32,
21785 #[doc = "System ID (0 for broadcast)."]
21786 pub target_system: u8,
21787 #[doc = "Component ID (0 for broadcast)."]
21788 pub target_component: u8,
21789 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21790 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21791 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21792 pub id_or_mac: [u8; 20],
21793 #[doc = "Indicates the type of authentication."]
21794 pub authentication_type: MavOdidAuthType,
21795 #[doc = "Allowed range is 0 - 15."]
21796 pub data_page: u8,
21797 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21798 pub last_page_index: u8,
21799 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21800 pub length: u8,
21801 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21803 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21804 pub authentication_data: [u8; 23],
21805}
21806impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21807 pub const ENCODED_LEN: usize = 53usize;
21808 pub const DEFAULT: Self = Self {
21809 timestamp: 0_u32,
21810 target_system: 0_u8,
21811 target_component: 0_u8,
21812 id_or_mac: [0_u8; 20usize],
21813 authentication_type: MavOdidAuthType::DEFAULT,
21814 data_page: 0_u8,
21815 last_page_index: 0_u8,
21816 length: 0_u8,
21817 authentication_data: [0_u8; 23usize],
21818 };
21819 #[cfg(feature = "arbitrary")]
21820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21821 use arbitrary::{Arbitrary, Unstructured};
21822 let mut buf = [0u8; 1024];
21823 rng.fill_bytes(&mut buf);
21824 let mut unstructured = Unstructured::new(&buf);
21825 Self::arbitrary(&mut unstructured).unwrap_or_default()
21826 }
21827}
21828impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21829 fn default() -> Self {
21830 Self::DEFAULT.clone()
21831 }
21832}
21833impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21834 type Message = MavMessage;
21835 const ID: u32 = 12902u32;
21836 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21837 const EXTRA_CRC: u8 = 140u8;
21838 const ENCODED_LEN: usize = 53usize;
21839 fn deser(
21840 _version: MavlinkVersion,
21841 __input: &[u8],
21842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21843 let avail_len = __input.len();
21844 let mut payload_buf = [0; Self::ENCODED_LEN];
21845 let mut buf = if avail_len < Self::ENCODED_LEN {
21846 payload_buf[0..avail_len].copy_from_slice(__input);
21847 Bytes::new(&payload_buf)
21848 } else {
21849 Bytes::new(__input)
21850 };
21851 let mut __struct = Self::default();
21852 __struct.timestamp = buf.get_u32_le()?;
21853 __struct.target_system = buf.get_u8()?;
21854 __struct.target_component = buf.get_u8()?;
21855 for v in &mut __struct.id_or_mac {
21856 let val = buf.get_u8()?;
21857 *v = val;
21858 }
21859 let tmp = buf.get_u8()?;
21860 __struct.authentication_type =
21861 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21862 enum_type: "MavOdidAuthType",
21863 value: tmp as u64,
21864 })?;
21865 __struct.data_page = buf.get_u8()?;
21866 __struct.last_page_index = buf.get_u8()?;
21867 __struct.length = buf.get_u8()?;
21868 for v in &mut __struct.authentication_data {
21869 let val = buf.get_u8()?;
21870 *v = val;
21871 }
21872 Ok(__struct)
21873 }
21874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21875 let mut __tmp = BytesMut::new(bytes);
21876 #[allow(clippy::absurd_extreme_comparisons)]
21877 #[allow(unused_comparisons)]
21878 if __tmp.remaining() < Self::ENCODED_LEN {
21879 panic!(
21880 "buffer is too small (need {} bytes, but got {})",
21881 Self::ENCODED_LEN,
21882 __tmp.remaining(),
21883 )
21884 }
21885 __tmp.put_u32_le(self.timestamp);
21886 __tmp.put_u8(self.target_system);
21887 __tmp.put_u8(self.target_component);
21888 for val in &self.id_or_mac {
21889 __tmp.put_u8(*val);
21890 }
21891 __tmp.put_u8(self.authentication_type as u8);
21892 __tmp.put_u8(self.data_page);
21893 __tmp.put_u8(self.last_page_index);
21894 __tmp.put_u8(self.length);
21895 for val in &self.authentication_data {
21896 __tmp.put_u8(*val);
21897 }
21898 if matches!(version, MavlinkVersion::V2) {
21899 let len = __tmp.len();
21900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21901 } else {
21902 __tmp.len()
21903 }
21904 }
21905}
21906#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21907#[doc = ""]
21908#[doc = "ID: 12900"]
21909#[derive(Debug, Clone, PartialEq)]
21910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21912#[cfg_attr(feature = "ts", derive(TS))]
21913#[cfg_attr(feature = "ts", ts(export))]
21914pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21915 #[doc = "System ID (0 for broadcast)."]
21916 pub target_system: u8,
21917 #[doc = "Component ID (0 for broadcast)."]
21918 pub target_component: u8,
21919 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21922 pub id_or_mac: [u8; 20],
21923 #[doc = "Indicates the format for the uas_id field of this message."]
21924 pub id_type: MavOdidIdType,
21925 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21926 pub ua_type: MavOdidUaType,
21927 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21929 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21930 pub uas_id: [u8; 20],
21931}
21932impl OPEN_DRONE_ID_BASIC_ID_DATA {
21933 pub const ENCODED_LEN: usize = 44usize;
21934 pub const DEFAULT: Self = Self {
21935 target_system: 0_u8,
21936 target_component: 0_u8,
21937 id_or_mac: [0_u8; 20usize],
21938 id_type: MavOdidIdType::DEFAULT,
21939 ua_type: MavOdidUaType::DEFAULT,
21940 uas_id: [0_u8; 20usize],
21941 };
21942 #[cfg(feature = "arbitrary")]
21943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21944 use arbitrary::{Arbitrary, Unstructured};
21945 let mut buf = [0u8; 1024];
21946 rng.fill_bytes(&mut buf);
21947 let mut unstructured = Unstructured::new(&buf);
21948 Self::arbitrary(&mut unstructured).unwrap_or_default()
21949 }
21950}
21951impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21952 fn default() -> Self {
21953 Self::DEFAULT.clone()
21954 }
21955}
21956impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21957 type Message = MavMessage;
21958 const ID: u32 = 12900u32;
21959 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21960 const EXTRA_CRC: u8 = 114u8;
21961 const ENCODED_LEN: usize = 44usize;
21962 fn deser(
21963 _version: MavlinkVersion,
21964 __input: &[u8],
21965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21966 let avail_len = __input.len();
21967 let mut payload_buf = [0; Self::ENCODED_LEN];
21968 let mut buf = if avail_len < Self::ENCODED_LEN {
21969 payload_buf[0..avail_len].copy_from_slice(__input);
21970 Bytes::new(&payload_buf)
21971 } else {
21972 Bytes::new(__input)
21973 };
21974 let mut __struct = Self::default();
21975 __struct.target_system = buf.get_u8()?;
21976 __struct.target_component = buf.get_u8()?;
21977 for v in &mut __struct.id_or_mac {
21978 let val = buf.get_u8()?;
21979 *v = val;
21980 }
21981 let tmp = buf.get_u8()?;
21982 __struct.id_type =
21983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21984 enum_type: "MavOdidIdType",
21985 value: tmp as u64,
21986 })?;
21987 let tmp = buf.get_u8()?;
21988 __struct.ua_type =
21989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21990 enum_type: "MavOdidUaType",
21991 value: tmp as u64,
21992 })?;
21993 for v in &mut __struct.uas_id {
21994 let val = buf.get_u8()?;
21995 *v = val;
21996 }
21997 Ok(__struct)
21998 }
21999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22000 let mut __tmp = BytesMut::new(bytes);
22001 #[allow(clippy::absurd_extreme_comparisons)]
22002 #[allow(unused_comparisons)]
22003 if __tmp.remaining() < Self::ENCODED_LEN {
22004 panic!(
22005 "buffer is too small (need {} bytes, but got {})",
22006 Self::ENCODED_LEN,
22007 __tmp.remaining(),
22008 )
22009 }
22010 __tmp.put_u8(self.target_system);
22011 __tmp.put_u8(self.target_component);
22012 for val in &self.id_or_mac {
22013 __tmp.put_u8(*val);
22014 }
22015 __tmp.put_u8(self.id_type as u8);
22016 __tmp.put_u8(self.ua_type as u8);
22017 for val in &self.uas_id {
22018 __tmp.put_u8(*val);
22019 }
22020 if matches!(version, MavlinkVersion::V2) {
22021 let len = __tmp.len();
22022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22023 } else {
22024 __tmp.len()
22025 }
22026 }
22027}
22028#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22029#[doc = ""]
22030#[doc = "ID: 12901"]
22031#[derive(Debug, Clone, PartialEq)]
22032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22034#[cfg_attr(feature = "ts", derive(TS))]
22035#[cfg_attr(feature = "ts", ts(export))]
22036pub struct OPEN_DRONE_ID_LOCATION_DATA {
22037 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22038 pub latitude: i32,
22039 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22040 pub longitude: i32,
22041 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22042 pub altitude_barometric: f32,
22043 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22044 pub altitude_geodetic: f32,
22045 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22046 pub height: f32,
22047 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22048 pub timestamp: f32,
22049 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22050 pub direction: u16,
22051 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22052 pub speed_horizontal: u16,
22053 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22054 pub speed_vertical: i16,
22055 #[doc = "System ID (0 for broadcast)."]
22056 pub target_system: u8,
22057 #[doc = "Component ID (0 for broadcast)."]
22058 pub target_component: u8,
22059 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22060 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22061 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22062 pub id_or_mac: [u8; 20],
22063 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22064 pub status: MavOdidStatus,
22065 #[doc = "Indicates the reference point for the height field."]
22066 pub height_reference: MavOdidHeightRef,
22067 #[doc = "The accuracy of the horizontal position."]
22068 pub horizontal_accuracy: MavOdidHorAcc,
22069 #[doc = "The accuracy of the vertical position."]
22070 pub vertical_accuracy: MavOdidVerAcc,
22071 #[doc = "The accuracy of the barometric altitude."]
22072 pub barometer_accuracy: MavOdidVerAcc,
22073 #[doc = "The accuracy of the horizontal and vertical speed."]
22074 pub speed_accuracy: MavOdidSpeedAcc,
22075 #[doc = "The accuracy of the timestamps."]
22076 pub timestamp_accuracy: MavOdidTimeAcc,
22077}
22078impl OPEN_DRONE_ID_LOCATION_DATA {
22079 pub const ENCODED_LEN: usize = 59usize;
22080 pub const DEFAULT: Self = Self {
22081 latitude: 0_i32,
22082 longitude: 0_i32,
22083 altitude_barometric: 0.0_f32,
22084 altitude_geodetic: 0.0_f32,
22085 height: 0.0_f32,
22086 timestamp: 0.0_f32,
22087 direction: 0_u16,
22088 speed_horizontal: 0_u16,
22089 speed_vertical: 0_i16,
22090 target_system: 0_u8,
22091 target_component: 0_u8,
22092 id_or_mac: [0_u8; 20usize],
22093 status: MavOdidStatus::DEFAULT,
22094 height_reference: MavOdidHeightRef::DEFAULT,
22095 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22096 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22097 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22098 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22099 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22100 };
22101 #[cfg(feature = "arbitrary")]
22102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22103 use arbitrary::{Arbitrary, Unstructured};
22104 let mut buf = [0u8; 1024];
22105 rng.fill_bytes(&mut buf);
22106 let mut unstructured = Unstructured::new(&buf);
22107 Self::arbitrary(&mut unstructured).unwrap_or_default()
22108 }
22109}
22110impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22111 fn default() -> Self {
22112 Self::DEFAULT.clone()
22113 }
22114}
22115impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22116 type Message = MavMessage;
22117 const ID: u32 = 12901u32;
22118 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22119 const EXTRA_CRC: u8 = 254u8;
22120 const ENCODED_LEN: usize = 59usize;
22121 fn deser(
22122 _version: MavlinkVersion,
22123 __input: &[u8],
22124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22125 let avail_len = __input.len();
22126 let mut payload_buf = [0; Self::ENCODED_LEN];
22127 let mut buf = if avail_len < Self::ENCODED_LEN {
22128 payload_buf[0..avail_len].copy_from_slice(__input);
22129 Bytes::new(&payload_buf)
22130 } else {
22131 Bytes::new(__input)
22132 };
22133 let mut __struct = Self::default();
22134 __struct.latitude = buf.get_i32_le()?;
22135 __struct.longitude = buf.get_i32_le()?;
22136 __struct.altitude_barometric = buf.get_f32_le()?;
22137 __struct.altitude_geodetic = buf.get_f32_le()?;
22138 __struct.height = buf.get_f32_le()?;
22139 __struct.timestamp = buf.get_f32_le()?;
22140 __struct.direction = buf.get_u16_le()?;
22141 __struct.speed_horizontal = buf.get_u16_le()?;
22142 __struct.speed_vertical = buf.get_i16_le()?;
22143 __struct.target_system = buf.get_u8()?;
22144 __struct.target_component = buf.get_u8()?;
22145 for v in &mut __struct.id_or_mac {
22146 let val = buf.get_u8()?;
22147 *v = val;
22148 }
22149 let tmp = buf.get_u8()?;
22150 __struct.status =
22151 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22152 enum_type: "MavOdidStatus",
22153 value: tmp as u64,
22154 })?;
22155 let tmp = buf.get_u8()?;
22156 __struct.height_reference =
22157 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22158 enum_type: "MavOdidHeightRef",
22159 value: tmp as u64,
22160 })?;
22161 let tmp = buf.get_u8()?;
22162 __struct.horizontal_accuracy =
22163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22164 enum_type: "MavOdidHorAcc",
22165 value: tmp as u64,
22166 })?;
22167 let tmp = buf.get_u8()?;
22168 __struct.vertical_accuracy =
22169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22170 enum_type: "MavOdidVerAcc",
22171 value: tmp as u64,
22172 })?;
22173 let tmp = buf.get_u8()?;
22174 __struct.barometer_accuracy =
22175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22176 enum_type: "MavOdidVerAcc",
22177 value: tmp as u64,
22178 })?;
22179 let tmp = buf.get_u8()?;
22180 __struct.speed_accuracy =
22181 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22182 enum_type: "MavOdidSpeedAcc",
22183 value: tmp as u64,
22184 })?;
22185 let tmp = buf.get_u8()?;
22186 __struct.timestamp_accuracy =
22187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22188 enum_type: "MavOdidTimeAcc",
22189 value: tmp as u64,
22190 })?;
22191 Ok(__struct)
22192 }
22193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22194 let mut __tmp = BytesMut::new(bytes);
22195 #[allow(clippy::absurd_extreme_comparisons)]
22196 #[allow(unused_comparisons)]
22197 if __tmp.remaining() < Self::ENCODED_LEN {
22198 panic!(
22199 "buffer is too small (need {} bytes, but got {})",
22200 Self::ENCODED_LEN,
22201 __tmp.remaining(),
22202 )
22203 }
22204 __tmp.put_i32_le(self.latitude);
22205 __tmp.put_i32_le(self.longitude);
22206 __tmp.put_f32_le(self.altitude_barometric);
22207 __tmp.put_f32_le(self.altitude_geodetic);
22208 __tmp.put_f32_le(self.height);
22209 __tmp.put_f32_le(self.timestamp);
22210 __tmp.put_u16_le(self.direction);
22211 __tmp.put_u16_le(self.speed_horizontal);
22212 __tmp.put_i16_le(self.speed_vertical);
22213 __tmp.put_u8(self.target_system);
22214 __tmp.put_u8(self.target_component);
22215 for val in &self.id_or_mac {
22216 __tmp.put_u8(*val);
22217 }
22218 __tmp.put_u8(self.status as u8);
22219 __tmp.put_u8(self.height_reference as u8);
22220 __tmp.put_u8(self.horizontal_accuracy as u8);
22221 __tmp.put_u8(self.vertical_accuracy as u8);
22222 __tmp.put_u8(self.barometer_accuracy as u8);
22223 __tmp.put_u8(self.speed_accuracy as u8);
22224 __tmp.put_u8(self.timestamp_accuracy as u8);
22225 if matches!(version, MavlinkVersion::V2) {
22226 let len = __tmp.len();
22227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22228 } else {
22229 __tmp.len()
22230 }
22231 }
22232}
22233#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22234#[doc = ""]
22235#[doc = "ID: 12915"]
22236#[derive(Debug, Clone, PartialEq)]
22237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22239#[cfg_attr(feature = "ts", derive(TS))]
22240#[cfg_attr(feature = "ts", ts(export))]
22241pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22242 #[doc = "System ID (0 for broadcast)."]
22243 pub target_system: u8,
22244 #[doc = "Component ID (0 for broadcast)."]
22245 pub target_component: u8,
22246 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22247 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22248 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22249 pub id_or_mac: [u8; 20],
22250 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22251 pub single_message_size: u8,
22252 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22253 pub msg_pack_size: u8,
22254 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22255 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22256 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22257 pub messages: [u8; 225],
22258}
22259impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22260 pub const ENCODED_LEN: usize = 249usize;
22261 pub const DEFAULT: Self = Self {
22262 target_system: 0_u8,
22263 target_component: 0_u8,
22264 id_or_mac: [0_u8; 20usize],
22265 single_message_size: 0_u8,
22266 msg_pack_size: 0_u8,
22267 messages: [0_u8; 225usize],
22268 };
22269 #[cfg(feature = "arbitrary")]
22270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22271 use arbitrary::{Arbitrary, Unstructured};
22272 let mut buf = [0u8; 1024];
22273 rng.fill_bytes(&mut buf);
22274 let mut unstructured = Unstructured::new(&buf);
22275 Self::arbitrary(&mut unstructured).unwrap_or_default()
22276 }
22277}
22278impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22279 fn default() -> Self {
22280 Self::DEFAULT.clone()
22281 }
22282}
22283impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22284 type Message = MavMessage;
22285 const ID: u32 = 12915u32;
22286 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22287 const EXTRA_CRC: u8 = 94u8;
22288 const ENCODED_LEN: usize = 249usize;
22289 fn deser(
22290 _version: MavlinkVersion,
22291 __input: &[u8],
22292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22293 let avail_len = __input.len();
22294 let mut payload_buf = [0; Self::ENCODED_LEN];
22295 let mut buf = if avail_len < Self::ENCODED_LEN {
22296 payload_buf[0..avail_len].copy_from_slice(__input);
22297 Bytes::new(&payload_buf)
22298 } else {
22299 Bytes::new(__input)
22300 };
22301 let mut __struct = Self::default();
22302 __struct.target_system = buf.get_u8()?;
22303 __struct.target_component = buf.get_u8()?;
22304 for v in &mut __struct.id_or_mac {
22305 let val = buf.get_u8()?;
22306 *v = val;
22307 }
22308 __struct.single_message_size = buf.get_u8()?;
22309 __struct.msg_pack_size = buf.get_u8()?;
22310 for v in &mut __struct.messages {
22311 let val = buf.get_u8()?;
22312 *v = val;
22313 }
22314 Ok(__struct)
22315 }
22316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22317 let mut __tmp = BytesMut::new(bytes);
22318 #[allow(clippy::absurd_extreme_comparisons)]
22319 #[allow(unused_comparisons)]
22320 if __tmp.remaining() < Self::ENCODED_LEN {
22321 panic!(
22322 "buffer is too small (need {} bytes, but got {})",
22323 Self::ENCODED_LEN,
22324 __tmp.remaining(),
22325 )
22326 }
22327 __tmp.put_u8(self.target_system);
22328 __tmp.put_u8(self.target_component);
22329 for val in &self.id_or_mac {
22330 __tmp.put_u8(*val);
22331 }
22332 __tmp.put_u8(self.single_message_size);
22333 __tmp.put_u8(self.msg_pack_size);
22334 for val in &self.messages {
22335 __tmp.put_u8(*val);
22336 }
22337 if matches!(version, MavlinkVersion::V2) {
22338 let len = __tmp.len();
22339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22340 } else {
22341 __tmp.len()
22342 }
22343 }
22344}
22345#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22346#[doc = ""]
22347#[doc = "ID: 12905"]
22348#[derive(Debug, Clone, PartialEq)]
22349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22351#[cfg_attr(feature = "ts", derive(TS))]
22352#[cfg_attr(feature = "ts", ts(export))]
22353pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22354 #[doc = "System ID (0 for broadcast)."]
22355 pub target_system: u8,
22356 #[doc = "Component ID (0 for broadcast)."]
22357 pub target_component: u8,
22358 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22359 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22360 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22361 pub id_or_mac: [u8; 20],
22362 #[doc = "Indicates the type of the operator_id field."]
22363 pub operator_id_type: MavOdidOperatorIdType,
22364 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22365 #[cfg_attr(feature = "ts", ts(type = "string"))]
22366 pub operator_id: CharArray<20>,
22367}
22368impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22369 pub const ENCODED_LEN: usize = 43usize;
22370 pub const DEFAULT: Self = Self {
22371 target_system: 0_u8,
22372 target_component: 0_u8,
22373 id_or_mac: [0_u8; 20usize],
22374 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22375 operator_id: CharArray::new([0_u8; 20usize]),
22376 };
22377 #[cfg(feature = "arbitrary")]
22378 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22379 use arbitrary::{Arbitrary, Unstructured};
22380 let mut buf = [0u8; 1024];
22381 rng.fill_bytes(&mut buf);
22382 let mut unstructured = Unstructured::new(&buf);
22383 Self::arbitrary(&mut unstructured).unwrap_or_default()
22384 }
22385}
22386impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22387 fn default() -> Self {
22388 Self::DEFAULT.clone()
22389 }
22390}
22391impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22392 type Message = MavMessage;
22393 const ID: u32 = 12905u32;
22394 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22395 const EXTRA_CRC: u8 = 49u8;
22396 const ENCODED_LEN: usize = 43usize;
22397 fn deser(
22398 _version: MavlinkVersion,
22399 __input: &[u8],
22400 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22401 let avail_len = __input.len();
22402 let mut payload_buf = [0; Self::ENCODED_LEN];
22403 let mut buf = if avail_len < Self::ENCODED_LEN {
22404 payload_buf[0..avail_len].copy_from_slice(__input);
22405 Bytes::new(&payload_buf)
22406 } else {
22407 Bytes::new(__input)
22408 };
22409 let mut __struct = Self::default();
22410 __struct.target_system = buf.get_u8()?;
22411 __struct.target_component = buf.get_u8()?;
22412 for v in &mut __struct.id_or_mac {
22413 let val = buf.get_u8()?;
22414 *v = val;
22415 }
22416 let tmp = buf.get_u8()?;
22417 __struct.operator_id_type =
22418 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22419 enum_type: "MavOdidOperatorIdType",
22420 value: tmp as u64,
22421 })?;
22422 let mut tmp = [0_u8; 20usize];
22423 for v in &mut tmp {
22424 *v = buf.get_u8()?;
22425 }
22426 __struct.operator_id = CharArray::new(tmp);
22427 Ok(__struct)
22428 }
22429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22430 let mut __tmp = BytesMut::new(bytes);
22431 #[allow(clippy::absurd_extreme_comparisons)]
22432 #[allow(unused_comparisons)]
22433 if __tmp.remaining() < Self::ENCODED_LEN {
22434 panic!(
22435 "buffer is too small (need {} bytes, but got {})",
22436 Self::ENCODED_LEN,
22437 __tmp.remaining(),
22438 )
22439 }
22440 __tmp.put_u8(self.target_system);
22441 __tmp.put_u8(self.target_component);
22442 for val in &self.id_or_mac {
22443 __tmp.put_u8(*val);
22444 }
22445 __tmp.put_u8(self.operator_id_type as u8);
22446 for val in &self.operator_id {
22447 __tmp.put_u8(*val);
22448 }
22449 if matches!(version, MavlinkVersion::V2) {
22450 let len = __tmp.len();
22451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22452 } else {
22453 __tmp.len()
22454 }
22455 }
22456}
22457#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22458#[doc = ""]
22459#[doc = "ID: 12903"]
22460#[derive(Debug, Clone, PartialEq)]
22461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22463#[cfg_attr(feature = "ts", derive(TS))]
22464#[cfg_attr(feature = "ts", ts(export))]
22465pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22466 #[doc = "System ID (0 for broadcast)."]
22467 pub target_system: u8,
22468 #[doc = "Component ID (0 for broadcast)."]
22469 pub target_component: u8,
22470 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22472 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22473 pub id_or_mac: [u8; 20],
22474 #[doc = "Indicates the type of the description field."]
22475 pub description_type: MavOdidDescType,
22476 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22477 #[cfg_attr(feature = "ts", ts(type = "string"))]
22478 pub description: CharArray<23>,
22479}
22480impl OPEN_DRONE_ID_SELF_ID_DATA {
22481 pub const ENCODED_LEN: usize = 46usize;
22482 pub const DEFAULT: Self = Self {
22483 target_system: 0_u8,
22484 target_component: 0_u8,
22485 id_or_mac: [0_u8; 20usize],
22486 description_type: MavOdidDescType::DEFAULT,
22487 description: CharArray::new([0_u8; 23usize]),
22488 };
22489 #[cfg(feature = "arbitrary")]
22490 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22491 use arbitrary::{Arbitrary, Unstructured};
22492 let mut buf = [0u8; 1024];
22493 rng.fill_bytes(&mut buf);
22494 let mut unstructured = Unstructured::new(&buf);
22495 Self::arbitrary(&mut unstructured).unwrap_or_default()
22496 }
22497}
22498impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22499 fn default() -> Self {
22500 Self::DEFAULT.clone()
22501 }
22502}
22503impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22504 type Message = MavMessage;
22505 const ID: u32 = 12903u32;
22506 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22507 const EXTRA_CRC: u8 = 249u8;
22508 const ENCODED_LEN: usize = 46usize;
22509 fn deser(
22510 _version: MavlinkVersion,
22511 __input: &[u8],
22512 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22513 let avail_len = __input.len();
22514 let mut payload_buf = [0; Self::ENCODED_LEN];
22515 let mut buf = if avail_len < Self::ENCODED_LEN {
22516 payload_buf[0..avail_len].copy_from_slice(__input);
22517 Bytes::new(&payload_buf)
22518 } else {
22519 Bytes::new(__input)
22520 };
22521 let mut __struct = Self::default();
22522 __struct.target_system = buf.get_u8()?;
22523 __struct.target_component = buf.get_u8()?;
22524 for v in &mut __struct.id_or_mac {
22525 let val = buf.get_u8()?;
22526 *v = val;
22527 }
22528 let tmp = buf.get_u8()?;
22529 __struct.description_type =
22530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22531 enum_type: "MavOdidDescType",
22532 value: tmp as u64,
22533 })?;
22534 let mut tmp = [0_u8; 23usize];
22535 for v in &mut tmp {
22536 *v = buf.get_u8()?;
22537 }
22538 __struct.description = CharArray::new(tmp);
22539 Ok(__struct)
22540 }
22541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22542 let mut __tmp = BytesMut::new(bytes);
22543 #[allow(clippy::absurd_extreme_comparisons)]
22544 #[allow(unused_comparisons)]
22545 if __tmp.remaining() < Self::ENCODED_LEN {
22546 panic!(
22547 "buffer is too small (need {} bytes, but got {})",
22548 Self::ENCODED_LEN,
22549 __tmp.remaining(),
22550 )
22551 }
22552 __tmp.put_u8(self.target_system);
22553 __tmp.put_u8(self.target_component);
22554 for val in &self.id_or_mac {
22555 __tmp.put_u8(*val);
22556 }
22557 __tmp.put_u8(self.description_type as u8);
22558 for val in &self.description {
22559 __tmp.put_u8(*val);
22560 }
22561 if matches!(version, MavlinkVersion::V2) {
22562 let len = __tmp.len();
22563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22564 } else {
22565 __tmp.len()
22566 }
22567 }
22568}
22569#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22570#[doc = ""]
22571#[doc = "ID: 12904"]
22572#[derive(Debug, Clone, PartialEq)]
22573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22575#[cfg_attr(feature = "ts", derive(TS))]
22576#[cfg_attr(feature = "ts", ts(export))]
22577pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22578 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22579 pub operator_latitude: i32,
22580 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22581 pub operator_longitude: i32,
22582 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22583 pub area_ceiling: f32,
22584 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22585 pub area_floor: f32,
22586 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22587 pub operator_altitude_geo: f32,
22588 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22589 pub timestamp: u32,
22590 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22591 pub area_count: u16,
22592 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22593 pub area_radius: u16,
22594 #[doc = "System ID (0 for broadcast)."]
22595 pub target_system: u8,
22596 #[doc = "Component ID (0 for broadcast)."]
22597 pub target_component: u8,
22598 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22600 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22601 pub id_or_mac: [u8; 20],
22602 #[doc = "Specifies the operator location type."]
22603 pub operator_location_type: MavOdidOperatorLocationType,
22604 #[doc = "Specifies the classification type of the UA."]
22605 pub classification_type: MavOdidClassificationType,
22606 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22607 pub category_eu: MavOdidCategoryEu,
22608 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22609 pub class_eu: MavOdidClassEu,
22610}
22611impl OPEN_DRONE_ID_SYSTEM_DATA {
22612 pub const ENCODED_LEN: usize = 54usize;
22613 pub const DEFAULT: Self = Self {
22614 operator_latitude: 0_i32,
22615 operator_longitude: 0_i32,
22616 area_ceiling: 0.0_f32,
22617 area_floor: 0.0_f32,
22618 operator_altitude_geo: 0.0_f32,
22619 timestamp: 0_u32,
22620 area_count: 0_u16,
22621 area_radius: 0_u16,
22622 target_system: 0_u8,
22623 target_component: 0_u8,
22624 id_or_mac: [0_u8; 20usize],
22625 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22626 classification_type: MavOdidClassificationType::DEFAULT,
22627 category_eu: MavOdidCategoryEu::DEFAULT,
22628 class_eu: MavOdidClassEu::DEFAULT,
22629 };
22630 #[cfg(feature = "arbitrary")]
22631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22632 use arbitrary::{Arbitrary, Unstructured};
22633 let mut buf = [0u8; 1024];
22634 rng.fill_bytes(&mut buf);
22635 let mut unstructured = Unstructured::new(&buf);
22636 Self::arbitrary(&mut unstructured).unwrap_or_default()
22637 }
22638}
22639impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22640 fn default() -> Self {
22641 Self::DEFAULT.clone()
22642 }
22643}
22644impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22645 type Message = MavMessage;
22646 const ID: u32 = 12904u32;
22647 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22648 const EXTRA_CRC: u8 = 77u8;
22649 const ENCODED_LEN: usize = 54usize;
22650 fn deser(
22651 _version: MavlinkVersion,
22652 __input: &[u8],
22653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22654 let avail_len = __input.len();
22655 let mut payload_buf = [0; Self::ENCODED_LEN];
22656 let mut buf = if avail_len < Self::ENCODED_LEN {
22657 payload_buf[0..avail_len].copy_from_slice(__input);
22658 Bytes::new(&payload_buf)
22659 } else {
22660 Bytes::new(__input)
22661 };
22662 let mut __struct = Self::default();
22663 __struct.operator_latitude = buf.get_i32_le()?;
22664 __struct.operator_longitude = buf.get_i32_le()?;
22665 __struct.area_ceiling = buf.get_f32_le()?;
22666 __struct.area_floor = buf.get_f32_le()?;
22667 __struct.operator_altitude_geo = buf.get_f32_le()?;
22668 __struct.timestamp = buf.get_u32_le()?;
22669 __struct.area_count = buf.get_u16_le()?;
22670 __struct.area_radius = buf.get_u16_le()?;
22671 __struct.target_system = buf.get_u8()?;
22672 __struct.target_component = buf.get_u8()?;
22673 for v in &mut __struct.id_or_mac {
22674 let val = buf.get_u8()?;
22675 *v = val;
22676 }
22677 let tmp = buf.get_u8()?;
22678 __struct.operator_location_type =
22679 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22680 enum_type: "MavOdidOperatorLocationType",
22681 value: tmp as u64,
22682 })?;
22683 let tmp = buf.get_u8()?;
22684 __struct.classification_type =
22685 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22686 enum_type: "MavOdidClassificationType",
22687 value: tmp as u64,
22688 })?;
22689 let tmp = buf.get_u8()?;
22690 __struct.category_eu =
22691 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22692 enum_type: "MavOdidCategoryEu",
22693 value: tmp as u64,
22694 })?;
22695 let tmp = buf.get_u8()?;
22696 __struct.class_eu =
22697 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22698 enum_type: "MavOdidClassEu",
22699 value: tmp as u64,
22700 })?;
22701 Ok(__struct)
22702 }
22703 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22704 let mut __tmp = BytesMut::new(bytes);
22705 #[allow(clippy::absurd_extreme_comparisons)]
22706 #[allow(unused_comparisons)]
22707 if __tmp.remaining() < Self::ENCODED_LEN {
22708 panic!(
22709 "buffer is too small (need {} bytes, but got {})",
22710 Self::ENCODED_LEN,
22711 __tmp.remaining(),
22712 )
22713 }
22714 __tmp.put_i32_le(self.operator_latitude);
22715 __tmp.put_i32_le(self.operator_longitude);
22716 __tmp.put_f32_le(self.area_ceiling);
22717 __tmp.put_f32_le(self.area_floor);
22718 __tmp.put_f32_le(self.operator_altitude_geo);
22719 __tmp.put_u32_le(self.timestamp);
22720 __tmp.put_u16_le(self.area_count);
22721 __tmp.put_u16_le(self.area_radius);
22722 __tmp.put_u8(self.target_system);
22723 __tmp.put_u8(self.target_component);
22724 for val in &self.id_or_mac {
22725 __tmp.put_u8(*val);
22726 }
22727 __tmp.put_u8(self.operator_location_type as u8);
22728 __tmp.put_u8(self.classification_type as u8);
22729 __tmp.put_u8(self.category_eu as u8);
22730 __tmp.put_u8(self.class_eu as u8);
22731 if matches!(version, MavlinkVersion::V2) {
22732 let len = __tmp.len();
22733 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22734 } else {
22735 __tmp.len()
22736 }
22737 }
22738}
22739#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22740#[doc = ""]
22741#[doc = "ID: 12919"]
22742#[derive(Debug, Clone, PartialEq)]
22743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22744#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22745#[cfg_attr(feature = "ts", derive(TS))]
22746#[cfg_attr(feature = "ts", ts(export))]
22747pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22748 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22749 pub operator_latitude: i32,
22750 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22751 pub operator_longitude: i32,
22752 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22753 pub operator_altitude_geo: f32,
22754 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22755 pub timestamp: u32,
22756 #[doc = "System ID (0 for broadcast)."]
22757 pub target_system: u8,
22758 #[doc = "Component ID (0 for broadcast)."]
22759 pub target_component: u8,
22760}
22761impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22762 pub const ENCODED_LEN: usize = 18usize;
22763 pub const DEFAULT: Self = Self {
22764 operator_latitude: 0_i32,
22765 operator_longitude: 0_i32,
22766 operator_altitude_geo: 0.0_f32,
22767 timestamp: 0_u32,
22768 target_system: 0_u8,
22769 target_component: 0_u8,
22770 };
22771 #[cfg(feature = "arbitrary")]
22772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22773 use arbitrary::{Arbitrary, Unstructured};
22774 let mut buf = [0u8; 1024];
22775 rng.fill_bytes(&mut buf);
22776 let mut unstructured = Unstructured::new(&buf);
22777 Self::arbitrary(&mut unstructured).unwrap_or_default()
22778 }
22779}
22780impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22781 fn default() -> Self {
22782 Self::DEFAULT.clone()
22783 }
22784}
22785impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22786 type Message = MavMessage;
22787 const ID: u32 = 12919u32;
22788 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22789 const EXTRA_CRC: u8 = 7u8;
22790 const ENCODED_LEN: usize = 18usize;
22791 fn deser(
22792 _version: MavlinkVersion,
22793 __input: &[u8],
22794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22795 let avail_len = __input.len();
22796 let mut payload_buf = [0; Self::ENCODED_LEN];
22797 let mut buf = if avail_len < Self::ENCODED_LEN {
22798 payload_buf[0..avail_len].copy_from_slice(__input);
22799 Bytes::new(&payload_buf)
22800 } else {
22801 Bytes::new(__input)
22802 };
22803 let mut __struct = Self::default();
22804 __struct.operator_latitude = buf.get_i32_le()?;
22805 __struct.operator_longitude = buf.get_i32_le()?;
22806 __struct.operator_altitude_geo = buf.get_f32_le()?;
22807 __struct.timestamp = buf.get_u32_le()?;
22808 __struct.target_system = buf.get_u8()?;
22809 __struct.target_component = buf.get_u8()?;
22810 Ok(__struct)
22811 }
22812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22813 let mut __tmp = BytesMut::new(bytes);
22814 #[allow(clippy::absurd_extreme_comparisons)]
22815 #[allow(unused_comparisons)]
22816 if __tmp.remaining() < Self::ENCODED_LEN {
22817 panic!(
22818 "buffer is too small (need {} bytes, but got {})",
22819 Self::ENCODED_LEN,
22820 __tmp.remaining(),
22821 )
22822 }
22823 __tmp.put_i32_le(self.operator_latitude);
22824 __tmp.put_i32_le(self.operator_longitude);
22825 __tmp.put_f32_le(self.operator_altitude_geo);
22826 __tmp.put_u32_le(self.timestamp);
22827 __tmp.put_u8(self.target_system);
22828 __tmp.put_u8(self.target_component);
22829 if matches!(version, MavlinkVersion::V2) {
22830 let len = __tmp.len();
22831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22832 } else {
22833 __tmp.len()
22834 }
22835 }
22836}
22837#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22838#[doc = ""]
22839#[doc = "ID: 100"]
22840#[derive(Debug, Clone, PartialEq)]
22841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22843#[cfg_attr(feature = "ts", derive(TS))]
22844#[cfg_attr(feature = "ts", ts(export))]
22845pub struct OPTICAL_FLOW_DATA {
22846 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22847 pub time_usec: u64,
22848 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22849 pub flow_comp_m_x: f32,
22850 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22851 pub flow_comp_m_y: f32,
22852 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22853 pub ground_distance: f32,
22854 #[doc = "Flow in x-sensor direction"]
22855 pub flow_x: i16,
22856 #[doc = "Flow in y-sensor direction"]
22857 pub flow_y: i16,
22858 #[doc = "Sensor ID"]
22859 pub sensor_id: u8,
22860 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22861 pub quality: u8,
22862 #[doc = "Flow rate about X axis"]
22863 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22864 pub flow_rate_x: f32,
22865 #[doc = "Flow rate about Y axis"]
22866 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22867 pub flow_rate_y: f32,
22868}
22869impl OPTICAL_FLOW_DATA {
22870 pub const ENCODED_LEN: usize = 34usize;
22871 pub const DEFAULT: Self = Self {
22872 time_usec: 0_u64,
22873 flow_comp_m_x: 0.0_f32,
22874 flow_comp_m_y: 0.0_f32,
22875 ground_distance: 0.0_f32,
22876 flow_x: 0_i16,
22877 flow_y: 0_i16,
22878 sensor_id: 0_u8,
22879 quality: 0_u8,
22880 flow_rate_x: 0.0_f32,
22881 flow_rate_y: 0.0_f32,
22882 };
22883 #[cfg(feature = "arbitrary")]
22884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22885 use arbitrary::{Arbitrary, Unstructured};
22886 let mut buf = [0u8; 1024];
22887 rng.fill_bytes(&mut buf);
22888 let mut unstructured = Unstructured::new(&buf);
22889 Self::arbitrary(&mut unstructured).unwrap_or_default()
22890 }
22891}
22892impl Default for OPTICAL_FLOW_DATA {
22893 fn default() -> Self {
22894 Self::DEFAULT.clone()
22895 }
22896}
22897impl MessageData for OPTICAL_FLOW_DATA {
22898 type Message = MavMessage;
22899 const ID: u32 = 100u32;
22900 const NAME: &'static str = "OPTICAL_FLOW";
22901 const EXTRA_CRC: u8 = 175u8;
22902 const ENCODED_LEN: usize = 34usize;
22903 fn deser(
22904 _version: MavlinkVersion,
22905 __input: &[u8],
22906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22907 let avail_len = __input.len();
22908 let mut payload_buf = [0; Self::ENCODED_LEN];
22909 let mut buf = if avail_len < Self::ENCODED_LEN {
22910 payload_buf[0..avail_len].copy_from_slice(__input);
22911 Bytes::new(&payload_buf)
22912 } else {
22913 Bytes::new(__input)
22914 };
22915 let mut __struct = Self::default();
22916 __struct.time_usec = buf.get_u64_le()?;
22917 __struct.flow_comp_m_x = buf.get_f32_le()?;
22918 __struct.flow_comp_m_y = buf.get_f32_le()?;
22919 __struct.ground_distance = buf.get_f32_le()?;
22920 __struct.flow_x = buf.get_i16_le()?;
22921 __struct.flow_y = buf.get_i16_le()?;
22922 __struct.sensor_id = buf.get_u8()?;
22923 __struct.quality = buf.get_u8()?;
22924 __struct.flow_rate_x = buf.get_f32_le()?;
22925 __struct.flow_rate_y = buf.get_f32_le()?;
22926 Ok(__struct)
22927 }
22928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22929 let mut __tmp = BytesMut::new(bytes);
22930 #[allow(clippy::absurd_extreme_comparisons)]
22931 #[allow(unused_comparisons)]
22932 if __tmp.remaining() < Self::ENCODED_LEN {
22933 panic!(
22934 "buffer is too small (need {} bytes, but got {})",
22935 Self::ENCODED_LEN,
22936 __tmp.remaining(),
22937 )
22938 }
22939 __tmp.put_u64_le(self.time_usec);
22940 __tmp.put_f32_le(self.flow_comp_m_x);
22941 __tmp.put_f32_le(self.flow_comp_m_y);
22942 __tmp.put_f32_le(self.ground_distance);
22943 __tmp.put_i16_le(self.flow_x);
22944 __tmp.put_i16_le(self.flow_y);
22945 __tmp.put_u8(self.sensor_id);
22946 __tmp.put_u8(self.quality);
22947 if matches!(version, MavlinkVersion::V2) {
22948 __tmp.put_f32_le(self.flow_rate_x);
22949 __tmp.put_f32_le(self.flow_rate_y);
22950 let len = __tmp.len();
22951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22952 } else {
22953 __tmp.len()
22954 }
22955 }
22956}
22957#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22958#[doc = ""]
22959#[doc = "ID: 106"]
22960#[derive(Debug, Clone, PartialEq)]
22961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22963#[cfg_attr(feature = "ts", derive(TS))]
22964#[cfg_attr(feature = "ts", ts(export))]
22965pub struct OPTICAL_FLOW_RAD_DATA {
22966 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22967 pub time_usec: u64,
22968 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22969 pub integration_time_us: u32,
22970 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22971 pub integrated_x: f32,
22972 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22973 pub integrated_y: f32,
22974 #[doc = "RH rotation around X axis"]
22975 pub integrated_xgyro: f32,
22976 #[doc = "RH rotation around Y axis"]
22977 pub integrated_ygyro: f32,
22978 #[doc = "RH rotation around Z axis"]
22979 pub integrated_zgyro: f32,
22980 #[doc = "Time since the distance was sampled."]
22981 pub time_delta_distance_us: u32,
22982 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22983 pub distance: f32,
22984 #[doc = "Temperature"]
22985 pub temperature: i16,
22986 #[doc = "Sensor ID"]
22987 pub sensor_id: u8,
22988 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22989 pub quality: u8,
22990}
22991impl OPTICAL_FLOW_RAD_DATA {
22992 pub const ENCODED_LEN: usize = 44usize;
22993 pub const DEFAULT: Self = Self {
22994 time_usec: 0_u64,
22995 integration_time_us: 0_u32,
22996 integrated_x: 0.0_f32,
22997 integrated_y: 0.0_f32,
22998 integrated_xgyro: 0.0_f32,
22999 integrated_ygyro: 0.0_f32,
23000 integrated_zgyro: 0.0_f32,
23001 time_delta_distance_us: 0_u32,
23002 distance: 0.0_f32,
23003 temperature: 0_i16,
23004 sensor_id: 0_u8,
23005 quality: 0_u8,
23006 };
23007 #[cfg(feature = "arbitrary")]
23008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23009 use arbitrary::{Arbitrary, Unstructured};
23010 let mut buf = [0u8; 1024];
23011 rng.fill_bytes(&mut buf);
23012 let mut unstructured = Unstructured::new(&buf);
23013 Self::arbitrary(&mut unstructured).unwrap_or_default()
23014 }
23015}
23016impl Default for OPTICAL_FLOW_RAD_DATA {
23017 fn default() -> Self {
23018 Self::DEFAULT.clone()
23019 }
23020}
23021impl MessageData for OPTICAL_FLOW_RAD_DATA {
23022 type Message = MavMessage;
23023 const ID: u32 = 106u32;
23024 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23025 const EXTRA_CRC: u8 = 138u8;
23026 const ENCODED_LEN: usize = 44usize;
23027 fn deser(
23028 _version: MavlinkVersion,
23029 __input: &[u8],
23030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23031 let avail_len = __input.len();
23032 let mut payload_buf = [0; Self::ENCODED_LEN];
23033 let mut buf = if avail_len < Self::ENCODED_LEN {
23034 payload_buf[0..avail_len].copy_from_slice(__input);
23035 Bytes::new(&payload_buf)
23036 } else {
23037 Bytes::new(__input)
23038 };
23039 let mut __struct = Self::default();
23040 __struct.time_usec = buf.get_u64_le()?;
23041 __struct.integration_time_us = buf.get_u32_le()?;
23042 __struct.integrated_x = buf.get_f32_le()?;
23043 __struct.integrated_y = buf.get_f32_le()?;
23044 __struct.integrated_xgyro = buf.get_f32_le()?;
23045 __struct.integrated_ygyro = buf.get_f32_le()?;
23046 __struct.integrated_zgyro = buf.get_f32_le()?;
23047 __struct.time_delta_distance_us = buf.get_u32_le()?;
23048 __struct.distance = buf.get_f32_le()?;
23049 __struct.temperature = buf.get_i16_le()?;
23050 __struct.sensor_id = buf.get_u8()?;
23051 __struct.quality = buf.get_u8()?;
23052 Ok(__struct)
23053 }
23054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23055 let mut __tmp = BytesMut::new(bytes);
23056 #[allow(clippy::absurd_extreme_comparisons)]
23057 #[allow(unused_comparisons)]
23058 if __tmp.remaining() < Self::ENCODED_LEN {
23059 panic!(
23060 "buffer is too small (need {} bytes, but got {})",
23061 Self::ENCODED_LEN,
23062 __tmp.remaining(),
23063 )
23064 }
23065 __tmp.put_u64_le(self.time_usec);
23066 __tmp.put_u32_le(self.integration_time_us);
23067 __tmp.put_f32_le(self.integrated_x);
23068 __tmp.put_f32_le(self.integrated_y);
23069 __tmp.put_f32_le(self.integrated_xgyro);
23070 __tmp.put_f32_le(self.integrated_ygyro);
23071 __tmp.put_f32_le(self.integrated_zgyro);
23072 __tmp.put_u32_le(self.time_delta_distance_us);
23073 __tmp.put_f32_le(self.distance);
23074 __tmp.put_i16_le(self.temperature);
23075 __tmp.put_u8(self.sensor_id);
23076 __tmp.put_u8(self.quality);
23077 if matches!(version, MavlinkVersion::V2) {
23078 let len = __tmp.len();
23079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23080 } else {
23081 __tmp.len()
23082 }
23083 }
23084}
23085#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23086#[doc = ""]
23087#[doc = "ID: 360"]
23088#[derive(Debug, Clone, PartialEq)]
23089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23091#[cfg_attr(feature = "ts", derive(TS))]
23092#[cfg_attr(feature = "ts", ts(export))]
23093pub struct ORBIT_EXECUTION_STATUS_DATA {
23094 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23095 pub time_usec: u64,
23096 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23097 pub radius: f32,
23098 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23099 pub x: i32,
23100 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23101 pub y: i32,
23102 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23103 pub z: f32,
23104 #[doc = "The coordinate system of the fields: x, y, z."]
23105 pub frame: MavFrame,
23106}
23107impl ORBIT_EXECUTION_STATUS_DATA {
23108 pub const ENCODED_LEN: usize = 25usize;
23109 pub const DEFAULT: Self = Self {
23110 time_usec: 0_u64,
23111 radius: 0.0_f32,
23112 x: 0_i32,
23113 y: 0_i32,
23114 z: 0.0_f32,
23115 frame: MavFrame::DEFAULT,
23116 };
23117 #[cfg(feature = "arbitrary")]
23118 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23119 use arbitrary::{Arbitrary, Unstructured};
23120 let mut buf = [0u8; 1024];
23121 rng.fill_bytes(&mut buf);
23122 let mut unstructured = Unstructured::new(&buf);
23123 Self::arbitrary(&mut unstructured).unwrap_or_default()
23124 }
23125}
23126impl Default for ORBIT_EXECUTION_STATUS_DATA {
23127 fn default() -> Self {
23128 Self::DEFAULT.clone()
23129 }
23130}
23131impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23132 type Message = MavMessage;
23133 const ID: u32 = 360u32;
23134 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23135 const EXTRA_CRC: u8 = 11u8;
23136 const ENCODED_LEN: usize = 25usize;
23137 fn deser(
23138 _version: MavlinkVersion,
23139 __input: &[u8],
23140 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23141 let avail_len = __input.len();
23142 let mut payload_buf = [0; Self::ENCODED_LEN];
23143 let mut buf = if avail_len < Self::ENCODED_LEN {
23144 payload_buf[0..avail_len].copy_from_slice(__input);
23145 Bytes::new(&payload_buf)
23146 } else {
23147 Bytes::new(__input)
23148 };
23149 let mut __struct = Self::default();
23150 __struct.time_usec = buf.get_u64_le()?;
23151 __struct.radius = buf.get_f32_le()?;
23152 __struct.x = buf.get_i32_le()?;
23153 __struct.y = buf.get_i32_le()?;
23154 __struct.z = buf.get_f32_le()?;
23155 let tmp = buf.get_u8()?;
23156 __struct.frame =
23157 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23158 enum_type: "MavFrame",
23159 value: tmp as u64,
23160 })?;
23161 Ok(__struct)
23162 }
23163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23164 let mut __tmp = BytesMut::new(bytes);
23165 #[allow(clippy::absurd_extreme_comparisons)]
23166 #[allow(unused_comparisons)]
23167 if __tmp.remaining() < Self::ENCODED_LEN {
23168 panic!(
23169 "buffer is too small (need {} bytes, but got {})",
23170 Self::ENCODED_LEN,
23171 __tmp.remaining(),
23172 )
23173 }
23174 __tmp.put_u64_le(self.time_usec);
23175 __tmp.put_f32_le(self.radius);
23176 __tmp.put_i32_le(self.x);
23177 __tmp.put_i32_le(self.y);
23178 __tmp.put_f32_le(self.z);
23179 __tmp.put_u8(self.frame as u8);
23180 if matches!(version, MavlinkVersion::V2) {
23181 let len = __tmp.len();
23182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23183 } else {
23184 __tmp.len()
23185 }
23186 }
23187}
23188#[doc = "Response from a PARAM_EXT_SET message."]
23189#[doc = ""]
23190#[doc = "ID: 324"]
23191#[derive(Debug, Clone, PartialEq)]
23192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23194#[cfg_attr(feature = "ts", derive(TS))]
23195#[cfg_attr(feature = "ts", ts(export))]
23196pub struct PARAM_EXT_ACK_DATA {
23197 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23198 #[cfg_attr(feature = "ts", ts(type = "string"))]
23199 pub param_id: CharArray<16>,
23200 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23201 #[cfg_attr(feature = "ts", ts(type = "string"))]
23202 pub param_value: CharArray<128>,
23203 #[doc = "Parameter type."]
23204 pub param_type: MavParamExtType,
23205 #[doc = "Result code."]
23206 pub param_result: ParamAck,
23207}
23208impl PARAM_EXT_ACK_DATA {
23209 pub const ENCODED_LEN: usize = 146usize;
23210 pub const DEFAULT: Self = Self {
23211 param_id: CharArray::new([0_u8; 16usize]),
23212 param_value: CharArray::new([0_u8; 128usize]),
23213 param_type: MavParamExtType::DEFAULT,
23214 param_result: ParamAck::DEFAULT,
23215 };
23216 #[cfg(feature = "arbitrary")]
23217 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23218 use arbitrary::{Arbitrary, Unstructured};
23219 let mut buf = [0u8; 1024];
23220 rng.fill_bytes(&mut buf);
23221 let mut unstructured = Unstructured::new(&buf);
23222 Self::arbitrary(&mut unstructured).unwrap_or_default()
23223 }
23224}
23225impl Default for PARAM_EXT_ACK_DATA {
23226 fn default() -> Self {
23227 Self::DEFAULT.clone()
23228 }
23229}
23230impl MessageData for PARAM_EXT_ACK_DATA {
23231 type Message = MavMessage;
23232 const ID: u32 = 324u32;
23233 const NAME: &'static str = "PARAM_EXT_ACK";
23234 const EXTRA_CRC: u8 = 132u8;
23235 const ENCODED_LEN: usize = 146usize;
23236 fn deser(
23237 _version: MavlinkVersion,
23238 __input: &[u8],
23239 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23240 let avail_len = __input.len();
23241 let mut payload_buf = [0; Self::ENCODED_LEN];
23242 let mut buf = if avail_len < Self::ENCODED_LEN {
23243 payload_buf[0..avail_len].copy_from_slice(__input);
23244 Bytes::new(&payload_buf)
23245 } else {
23246 Bytes::new(__input)
23247 };
23248 let mut __struct = Self::default();
23249 let mut tmp = [0_u8; 16usize];
23250 for v in &mut tmp {
23251 *v = buf.get_u8()?;
23252 }
23253 __struct.param_id = CharArray::new(tmp);
23254 let mut tmp = [0_u8; 128usize];
23255 for v in &mut tmp {
23256 *v = buf.get_u8()?;
23257 }
23258 __struct.param_value = CharArray::new(tmp);
23259 let tmp = buf.get_u8()?;
23260 __struct.param_type =
23261 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23262 enum_type: "MavParamExtType",
23263 value: tmp as u64,
23264 })?;
23265 let tmp = buf.get_u8()?;
23266 __struct.param_result =
23267 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23268 enum_type: "ParamAck",
23269 value: tmp as u64,
23270 })?;
23271 Ok(__struct)
23272 }
23273 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23274 let mut __tmp = BytesMut::new(bytes);
23275 #[allow(clippy::absurd_extreme_comparisons)]
23276 #[allow(unused_comparisons)]
23277 if __tmp.remaining() < Self::ENCODED_LEN {
23278 panic!(
23279 "buffer is too small (need {} bytes, but got {})",
23280 Self::ENCODED_LEN,
23281 __tmp.remaining(),
23282 )
23283 }
23284 for val in &self.param_id {
23285 __tmp.put_u8(*val);
23286 }
23287 for val in &self.param_value {
23288 __tmp.put_u8(*val);
23289 }
23290 __tmp.put_u8(self.param_type as u8);
23291 __tmp.put_u8(self.param_result as u8);
23292 if matches!(version, MavlinkVersion::V2) {
23293 let len = __tmp.len();
23294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23295 } else {
23296 __tmp.len()
23297 }
23298 }
23299}
23300#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23301#[doc = ""]
23302#[doc = "ID: 321"]
23303#[derive(Debug, Clone, PartialEq)]
23304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23306#[cfg_attr(feature = "ts", derive(TS))]
23307#[cfg_attr(feature = "ts", ts(export))]
23308pub struct PARAM_EXT_REQUEST_LIST_DATA {
23309 #[doc = "System ID"]
23310 pub target_system: u8,
23311 #[doc = "Component ID"]
23312 pub target_component: u8,
23313}
23314impl PARAM_EXT_REQUEST_LIST_DATA {
23315 pub const ENCODED_LEN: usize = 2usize;
23316 pub const DEFAULT: Self = Self {
23317 target_system: 0_u8,
23318 target_component: 0_u8,
23319 };
23320 #[cfg(feature = "arbitrary")]
23321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23322 use arbitrary::{Arbitrary, Unstructured};
23323 let mut buf = [0u8; 1024];
23324 rng.fill_bytes(&mut buf);
23325 let mut unstructured = Unstructured::new(&buf);
23326 Self::arbitrary(&mut unstructured).unwrap_or_default()
23327 }
23328}
23329impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23330 fn default() -> Self {
23331 Self::DEFAULT.clone()
23332 }
23333}
23334impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23335 type Message = MavMessage;
23336 const ID: u32 = 321u32;
23337 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23338 const EXTRA_CRC: u8 = 88u8;
23339 const ENCODED_LEN: usize = 2usize;
23340 fn deser(
23341 _version: MavlinkVersion,
23342 __input: &[u8],
23343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23344 let avail_len = __input.len();
23345 let mut payload_buf = [0; Self::ENCODED_LEN];
23346 let mut buf = if avail_len < Self::ENCODED_LEN {
23347 payload_buf[0..avail_len].copy_from_slice(__input);
23348 Bytes::new(&payload_buf)
23349 } else {
23350 Bytes::new(__input)
23351 };
23352 let mut __struct = Self::default();
23353 __struct.target_system = buf.get_u8()?;
23354 __struct.target_component = buf.get_u8()?;
23355 Ok(__struct)
23356 }
23357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23358 let mut __tmp = BytesMut::new(bytes);
23359 #[allow(clippy::absurd_extreme_comparisons)]
23360 #[allow(unused_comparisons)]
23361 if __tmp.remaining() < Self::ENCODED_LEN {
23362 panic!(
23363 "buffer is too small (need {} bytes, but got {})",
23364 Self::ENCODED_LEN,
23365 __tmp.remaining(),
23366 )
23367 }
23368 __tmp.put_u8(self.target_system);
23369 __tmp.put_u8(self.target_component);
23370 if matches!(version, MavlinkVersion::V2) {
23371 let len = __tmp.len();
23372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23373 } else {
23374 __tmp.len()
23375 }
23376 }
23377}
23378#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23379#[doc = ""]
23380#[doc = "ID: 320"]
23381#[derive(Debug, Clone, PartialEq)]
23382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23384#[cfg_attr(feature = "ts", derive(TS))]
23385#[cfg_attr(feature = "ts", ts(export))]
23386pub struct PARAM_EXT_REQUEST_READ_DATA {
23387 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23388 pub param_index: i16,
23389 #[doc = "System ID"]
23390 pub target_system: u8,
23391 #[doc = "Component ID"]
23392 pub target_component: u8,
23393 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23394 #[cfg_attr(feature = "ts", ts(type = "string"))]
23395 pub param_id: CharArray<16>,
23396}
23397impl PARAM_EXT_REQUEST_READ_DATA {
23398 pub const ENCODED_LEN: usize = 20usize;
23399 pub const DEFAULT: Self = Self {
23400 param_index: 0_i16,
23401 target_system: 0_u8,
23402 target_component: 0_u8,
23403 param_id: CharArray::new([0_u8; 16usize]),
23404 };
23405 #[cfg(feature = "arbitrary")]
23406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23407 use arbitrary::{Arbitrary, Unstructured};
23408 let mut buf = [0u8; 1024];
23409 rng.fill_bytes(&mut buf);
23410 let mut unstructured = Unstructured::new(&buf);
23411 Self::arbitrary(&mut unstructured).unwrap_or_default()
23412 }
23413}
23414impl Default for PARAM_EXT_REQUEST_READ_DATA {
23415 fn default() -> Self {
23416 Self::DEFAULT.clone()
23417 }
23418}
23419impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23420 type Message = MavMessage;
23421 const ID: u32 = 320u32;
23422 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23423 const EXTRA_CRC: u8 = 243u8;
23424 const ENCODED_LEN: usize = 20usize;
23425 fn deser(
23426 _version: MavlinkVersion,
23427 __input: &[u8],
23428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23429 let avail_len = __input.len();
23430 let mut payload_buf = [0; Self::ENCODED_LEN];
23431 let mut buf = if avail_len < Self::ENCODED_LEN {
23432 payload_buf[0..avail_len].copy_from_slice(__input);
23433 Bytes::new(&payload_buf)
23434 } else {
23435 Bytes::new(__input)
23436 };
23437 let mut __struct = Self::default();
23438 __struct.param_index = buf.get_i16_le()?;
23439 __struct.target_system = buf.get_u8()?;
23440 __struct.target_component = buf.get_u8()?;
23441 let mut tmp = [0_u8; 16usize];
23442 for v in &mut tmp {
23443 *v = buf.get_u8()?;
23444 }
23445 __struct.param_id = CharArray::new(tmp);
23446 Ok(__struct)
23447 }
23448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23449 let mut __tmp = BytesMut::new(bytes);
23450 #[allow(clippy::absurd_extreme_comparisons)]
23451 #[allow(unused_comparisons)]
23452 if __tmp.remaining() < Self::ENCODED_LEN {
23453 panic!(
23454 "buffer is too small (need {} bytes, but got {})",
23455 Self::ENCODED_LEN,
23456 __tmp.remaining(),
23457 )
23458 }
23459 __tmp.put_i16_le(self.param_index);
23460 __tmp.put_u8(self.target_system);
23461 __tmp.put_u8(self.target_component);
23462 for val in &self.param_id {
23463 __tmp.put_u8(*val);
23464 }
23465 if matches!(version, MavlinkVersion::V2) {
23466 let len = __tmp.len();
23467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23468 } else {
23469 __tmp.len()
23470 }
23471 }
23472}
23473#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23474#[doc = ""]
23475#[doc = "ID: 323"]
23476#[derive(Debug, Clone, PartialEq)]
23477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23479#[cfg_attr(feature = "ts", derive(TS))]
23480#[cfg_attr(feature = "ts", ts(export))]
23481pub struct PARAM_EXT_SET_DATA {
23482 #[doc = "System ID"]
23483 pub target_system: u8,
23484 #[doc = "Component ID"]
23485 pub target_component: u8,
23486 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23487 #[cfg_attr(feature = "ts", ts(type = "string"))]
23488 pub param_id: CharArray<16>,
23489 #[doc = "Parameter value"]
23490 #[cfg_attr(feature = "ts", ts(type = "string"))]
23491 pub param_value: CharArray<128>,
23492 #[doc = "Parameter type."]
23493 pub param_type: MavParamExtType,
23494}
23495impl PARAM_EXT_SET_DATA {
23496 pub const ENCODED_LEN: usize = 147usize;
23497 pub const DEFAULT: Self = Self {
23498 target_system: 0_u8,
23499 target_component: 0_u8,
23500 param_id: CharArray::new([0_u8; 16usize]),
23501 param_value: CharArray::new([0_u8; 128usize]),
23502 param_type: MavParamExtType::DEFAULT,
23503 };
23504 #[cfg(feature = "arbitrary")]
23505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23506 use arbitrary::{Arbitrary, Unstructured};
23507 let mut buf = [0u8; 1024];
23508 rng.fill_bytes(&mut buf);
23509 let mut unstructured = Unstructured::new(&buf);
23510 Self::arbitrary(&mut unstructured).unwrap_or_default()
23511 }
23512}
23513impl Default for PARAM_EXT_SET_DATA {
23514 fn default() -> Self {
23515 Self::DEFAULT.clone()
23516 }
23517}
23518impl MessageData for PARAM_EXT_SET_DATA {
23519 type Message = MavMessage;
23520 const ID: u32 = 323u32;
23521 const NAME: &'static str = "PARAM_EXT_SET";
23522 const EXTRA_CRC: u8 = 78u8;
23523 const ENCODED_LEN: usize = 147usize;
23524 fn deser(
23525 _version: MavlinkVersion,
23526 __input: &[u8],
23527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23528 let avail_len = __input.len();
23529 let mut payload_buf = [0; Self::ENCODED_LEN];
23530 let mut buf = if avail_len < Self::ENCODED_LEN {
23531 payload_buf[0..avail_len].copy_from_slice(__input);
23532 Bytes::new(&payload_buf)
23533 } else {
23534 Bytes::new(__input)
23535 };
23536 let mut __struct = Self::default();
23537 __struct.target_system = buf.get_u8()?;
23538 __struct.target_component = buf.get_u8()?;
23539 let mut tmp = [0_u8; 16usize];
23540 for v in &mut tmp {
23541 *v = buf.get_u8()?;
23542 }
23543 __struct.param_id = CharArray::new(tmp);
23544 let mut tmp = [0_u8; 128usize];
23545 for v in &mut tmp {
23546 *v = buf.get_u8()?;
23547 }
23548 __struct.param_value = CharArray::new(tmp);
23549 let tmp = buf.get_u8()?;
23550 __struct.param_type =
23551 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23552 enum_type: "MavParamExtType",
23553 value: tmp as u64,
23554 })?;
23555 Ok(__struct)
23556 }
23557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23558 let mut __tmp = BytesMut::new(bytes);
23559 #[allow(clippy::absurd_extreme_comparisons)]
23560 #[allow(unused_comparisons)]
23561 if __tmp.remaining() < Self::ENCODED_LEN {
23562 panic!(
23563 "buffer is too small (need {} bytes, but got {})",
23564 Self::ENCODED_LEN,
23565 __tmp.remaining(),
23566 )
23567 }
23568 __tmp.put_u8(self.target_system);
23569 __tmp.put_u8(self.target_component);
23570 for val in &self.param_id {
23571 __tmp.put_u8(*val);
23572 }
23573 for val in &self.param_value {
23574 __tmp.put_u8(*val);
23575 }
23576 __tmp.put_u8(self.param_type as u8);
23577 if matches!(version, MavlinkVersion::V2) {
23578 let len = __tmp.len();
23579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23580 } else {
23581 __tmp.len()
23582 }
23583 }
23584}
23585#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23586#[doc = ""]
23587#[doc = "ID: 322"]
23588#[derive(Debug, Clone, PartialEq)]
23589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23590#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23591#[cfg_attr(feature = "ts", derive(TS))]
23592#[cfg_attr(feature = "ts", ts(export))]
23593pub struct PARAM_EXT_VALUE_DATA {
23594 #[doc = "Total number of parameters"]
23595 pub param_count: u16,
23596 #[doc = "Index of this parameter"]
23597 pub param_index: u16,
23598 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23599 #[cfg_attr(feature = "ts", ts(type = "string"))]
23600 pub param_id: CharArray<16>,
23601 #[doc = "Parameter value"]
23602 #[cfg_attr(feature = "ts", ts(type = "string"))]
23603 pub param_value: CharArray<128>,
23604 #[doc = "Parameter type."]
23605 pub param_type: MavParamExtType,
23606}
23607impl PARAM_EXT_VALUE_DATA {
23608 pub const ENCODED_LEN: usize = 149usize;
23609 pub const DEFAULT: Self = Self {
23610 param_count: 0_u16,
23611 param_index: 0_u16,
23612 param_id: CharArray::new([0_u8; 16usize]),
23613 param_value: CharArray::new([0_u8; 128usize]),
23614 param_type: MavParamExtType::DEFAULT,
23615 };
23616 #[cfg(feature = "arbitrary")]
23617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23618 use arbitrary::{Arbitrary, Unstructured};
23619 let mut buf = [0u8; 1024];
23620 rng.fill_bytes(&mut buf);
23621 let mut unstructured = Unstructured::new(&buf);
23622 Self::arbitrary(&mut unstructured).unwrap_or_default()
23623 }
23624}
23625impl Default for PARAM_EXT_VALUE_DATA {
23626 fn default() -> Self {
23627 Self::DEFAULT.clone()
23628 }
23629}
23630impl MessageData for PARAM_EXT_VALUE_DATA {
23631 type Message = MavMessage;
23632 const ID: u32 = 322u32;
23633 const NAME: &'static str = "PARAM_EXT_VALUE";
23634 const EXTRA_CRC: u8 = 243u8;
23635 const ENCODED_LEN: usize = 149usize;
23636 fn deser(
23637 _version: MavlinkVersion,
23638 __input: &[u8],
23639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23640 let avail_len = __input.len();
23641 let mut payload_buf = [0; Self::ENCODED_LEN];
23642 let mut buf = if avail_len < Self::ENCODED_LEN {
23643 payload_buf[0..avail_len].copy_from_slice(__input);
23644 Bytes::new(&payload_buf)
23645 } else {
23646 Bytes::new(__input)
23647 };
23648 let mut __struct = Self::default();
23649 __struct.param_count = buf.get_u16_le()?;
23650 __struct.param_index = buf.get_u16_le()?;
23651 let mut tmp = [0_u8; 16usize];
23652 for v in &mut tmp {
23653 *v = buf.get_u8()?;
23654 }
23655 __struct.param_id = CharArray::new(tmp);
23656 let mut tmp = [0_u8; 128usize];
23657 for v in &mut tmp {
23658 *v = buf.get_u8()?;
23659 }
23660 __struct.param_value = CharArray::new(tmp);
23661 let tmp = buf.get_u8()?;
23662 __struct.param_type =
23663 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23664 enum_type: "MavParamExtType",
23665 value: tmp as u64,
23666 })?;
23667 Ok(__struct)
23668 }
23669 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23670 let mut __tmp = BytesMut::new(bytes);
23671 #[allow(clippy::absurd_extreme_comparisons)]
23672 #[allow(unused_comparisons)]
23673 if __tmp.remaining() < Self::ENCODED_LEN {
23674 panic!(
23675 "buffer is too small (need {} bytes, but got {})",
23676 Self::ENCODED_LEN,
23677 __tmp.remaining(),
23678 )
23679 }
23680 __tmp.put_u16_le(self.param_count);
23681 __tmp.put_u16_le(self.param_index);
23682 for val in &self.param_id {
23683 __tmp.put_u8(*val);
23684 }
23685 for val in &self.param_value {
23686 __tmp.put_u8(*val);
23687 }
23688 __tmp.put_u8(self.param_type as u8);
23689 if matches!(version, MavlinkVersion::V2) {
23690 let len = __tmp.len();
23691 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23692 } else {
23693 __tmp.len()
23694 }
23695 }
23696}
23697#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23698#[doc = ""]
23699#[doc = "ID: 50"]
23700#[derive(Debug, Clone, PartialEq)]
23701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23703#[cfg_attr(feature = "ts", derive(TS))]
23704#[cfg_attr(feature = "ts", ts(export))]
23705pub struct PARAM_MAP_RC_DATA {
23706 #[doc = "Initial parameter value"]
23707 pub param_value0: f32,
23708 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23709 pub scale: f32,
23710 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23711 pub param_value_min: f32,
23712 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23713 pub param_value_max: f32,
23714 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23715 pub param_index: i16,
23716 #[doc = "System ID"]
23717 pub target_system: u8,
23718 #[doc = "Component ID"]
23719 pub target_component: u8,
23720 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23721 #[cfg_attr(feature = "ts", ts(type = "string"))]
23722 pub param_id: CharArray<16>,
23723 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23724 pub parameter_rc_channel_index: u8,
23725}
23726impl PARAM_MAP_RC_DATA {
23727 pub const ENCODED_LEN: usize = 37usize;
23728 pub const DEFAULT: Self = Self {
23729 param_value0: 0.0_f32,
23730 scale: 0.0_f32,
23731 param_value_min: 0.0_f32,
23732 param_value_max: 0.0_f32,
23733 param_index: 0_i16,
23734 target_system: 0_u8,
23735 target_component: 0_u8,
23736 param_id: CharArray::new([0_u8; 16usize]),
23737 parameter_rc_channel_index: 0_u8,
23738 };
23739 #[cfg(feature = "arbitrary")]
23740 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23741 use arbitrary::{Arbitrary, Unstructured};
23742 let mut buf = [0u8; 1024];
23743 rng.fill_bytes(&mut buf);
23744 let mut unstructured = Unstructured::new(&buf);
23745 Self::arbitrary(&mut unstructured).unwrap_or_default()
23746 }
23747}
23748impl Default for PARAM_MAP_RC_DATA {
23749 fn default() -> Self {
23750 Self::DEFAULT.clone()
23751 }
23752}
23753impl MessageData for PARAM_MAP_RC_DATA {
23754 type Message = MavMessage;
23755 const ID: u32 = 50u32;
23756 const NAME: &'static str = "PARAM_MAP_RC";
23757 const EXTRA_CRC: u8 = 78u8;
23758 const ENCODED_LEN: usize = 37usize;
23759 fn deser(
23760 _version: MavlinkVersion,
23761 __input: &[u8],
23762 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23763 let avail_len = __input.len();
23764 let mut payload_buf = [0; Self::ENCODED_LEN];
23765 let mut buf = if avail_len < Self::ENCODED_LEN {
23766 payload_buf[0..avail_len].copy_from_slice(__input);
23767 Bytes::new(&payload_buf)
23768 } else {
23769 Bytes::new(__input)
23770 };
23771 let mut __struct = Self::default();
23772 __struct.param_value0 = buf.get_f32_le()?;
23773 __struct.scale = buf.get_f32_le()?;
23774 __struct.param_value_min = buf.get_f32_le()?;
23775 __struct.param_value_max = buf.get_f32_le()?;
23776 __struct.param_index = buf.get_i16_le()?;
23777 __struct.target_system = buf.get_u8()?;
23778 __struct.target_component = buf.get_u8()?;
23779 let mut tmp = [0_u8; 16usize];
23780 for v in &mut tmp {
23781 *v = buf.get_u8()?;
23782 }
23783 __struct.param_id = CharArray::new(tmp);
23784 __struct.parameter_rc_channel_index = buf.get_u8()?;
23785 Ok(__struct)
23786 }
23787 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23788 let mut __tmp = BytesMut::new(bytes);
23789 #[allow(clippy::absurd_extreme_comparisons)]
23790 #[allow(unused_comparisons)]
23791 if __tmp.remaining() < Self::ENCODED_LEN {
23792 panic!(
23793 "buffer is too small (need {} bytes, but got {})",
23794 Self::ENCODED_LEN,
23795 __tmp.remaining(),
23796 )
23797 }
23798 __tmp.put_f32_le(self.param_value0);
23799 __tmp.put_f32_le(self.scale);
23800 __tmp.put_f32_le(self.param_value_min);
23801 __tmp.put_f32_le(self.param_value_max);
23802 __tmp.put_i16_le(self.param_index);
23803 __tmp.put_u8(self.target_system);
23804 __tmp.put_u8(self.target_component);
23805 for val in &self.param_id {
23806 __tmp.put_u8(*val);
23807 }
23808 __tmp.put_u8(self.parameter_rc_channel_index);
23809 if matches!(version, MavlinkVersion::V2) {
23810 let len = __tmp.len();
23811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23812 } else {
23813 __tmp.len()
23814 }
23815 }
23816}
23817#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23818#[doc = ""]
23819#[doc = "ID: 21"]
23820#[derive(Debug, Clone, PartialEq)]
23821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23823#[cfg_attr(feature = "ts", derive(TS))]
23824#[cfg_attr(feature = "ts", ts(export))]
23825pub struct PARAM_REQUEST_LIST_DATA {
23826 #[doc = "System ID"]
23827 pub target_system: u8,
23828 #[doc = "Component ID"]
23829 pub target_component: u8,
23830}
23831impl PARAM_REQUEST_LIST_DATA {
23832 pub const ENCODED_LEN: usize = 2usize;
23833 pub const DEFAULT: Self = Self {
23834 target_system: 0_u8,
23835 target_component: 0_u8,
23836 };
23837 #[cfg(feature = "arbitrary")]
23838 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23839 use arbitrary::{Arbitrary, Unstructured};
23840 let mut buf = [0u8; 1024];
23841 rng.fill_bytes(&mut buf);
23842 let mut unstructured = Unstructured::new(&buf);
23843 Self::arbitrary(&mut unstructured).unwrap_or_default()
23844 }
23845}
23846impl Default for PARAM_REQUEST_LIST_DATA {
23847 fn default() -> Self {
23848 Self::DEFAULT.clone()
23849 }
23850}
23851impl MessageData for PARAM_REQUEST_LIST_DATA {
23852 type Message = MavMessage;
23853 const ID: u32 = 21u32;
23854 const NAME: &'static str = "PARAM_REQUEST_LIST";
23855 const EXTRA_CRC: u8 = 159u8;
23856 const ENCODED_LEN: usize = 2usize;
23857 fn deser(
23858 _version: MavlinkVersion,
23859 __input: &[u8],
23860 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23861 let avail_len = __input.len();
23862 let mut payload_buf = [0; Self::ENCODED_LEN];
23863 let mut buf = if avail_len < Self::ENCODED_LEN {
23864 payload_buf[0..avail_len].copy_from_slice(__input);
23865 Bytes::new(&payload_buf)
23866 } else {
23867 Bytes::new(__input)
23868 };
23869 let mut __struct = Self::default();
23870 __struct.target_system = buf.get_u8()?;
23871 __struct.target_component = buf.get_u8()?;
23872 Ok(__struct)
23873 }
23874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23875 let mut __tmp = BytesMut::new(bytes);
23876 #[allow(clippy::absurd_extreme_comparisons)]
23877 #[allow(unused_comparisons)]
23878 if __tmp.remaining() < Self::ENCODED_LEN {
23879 panic!(
23880 "buffer is too small (need {} bytes, but got {})",
23881 Self::ENCODED_LEN,
23882 __tmp.remaining(),
23883 )
23884 }
23885 __tmp.put_u8(self.target_system);
23886 __tmp.put_u8(self.target_component);
23887 if matches!(version, MavlinkVersion::V2) {
23888 let len = __tmp.len();
23889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23890 } else {
23891 __tmp.len()
23892 }
23893 }
23894}
23895#[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23896#[doc = ""]
23897#[doc = "ID: 20"]
23898#[derive(Debug, Clone, PartialEq)]
23899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23901#[cfg_attr(feature = "ts", derive(TS))]
23902#[cfg_attr(feature = "ts", ts(export))]
23903pub struct PARAM_REQUEST_READ_DATA {
23904 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23905 pub param_index: i16,
23906 #[doc = "System ID"]
23907 pub target_system: u8,
23908 #[doc = "Component ID"]
23909 pub target_component: u8,
23910 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23911 #[cfg_attr(feature = "ts", ts(type = "string"))]
23912 pub param_id: CharArray<16>,
23913}
23914impl PARAM_REQUEST_READ_DATA {
23915 pub const ENCODED_LEN: usize = 20usize;
23916 pub const DEFAULT: Self = Self {
23917 param_index: 0_i16,
23918 target_system: 0_u8,
23919 target_component: 0_u8,
23920 param_id: CharArray::new([0_u8; 16usize]),
23921 };
23922 #[cfg(feature = "arbitrary")]
23923 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23924 use arbitrary::{Arbitrary, Unstructured};
23925 let mut buf = [0u8; 1024];
23926 rng.fill_bytes(&mut buf);
23927 let mut unstructured = Unstructured::new(&buf);
23928 Self::arbitrary(&mut unstructured).unwrap_or_default()
23929 }
23930}
23931impl Default for PARAM_REQUEST_READ_DATA {
23932 fn default() -> Self {
23933 Self::DEFAULT.clone()
23934 }
23935}
23936impl MessageData for PARAM_REQUEST_READ_DATA {
23937 type Message = MavMessage;
23938 const ID: u32 = 20u32;
23939 const NAME: &'static str = "PARAM_REQUEST_READ";
23940 const EXTRA_CRC: u8 = 214u8;
23941 const ENCODED_LEN: usize = 20usize;
23942 fn deser(
23943 _version: MavlinkVersion,
23944 __input: &[u8],
23945 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23946 let avail_len = __input.len();
23947 let mut payload_buf = [0; Self::ENCODED_LEN];
23948 let mut buf = if avail_len < Self::ENCODED_LEN {
23949 payload_buf[0..avail_len].copy_from_slice(__input);
23950 Bytes::new(&payload_buf)
23951 } else {
23952 Bytes::new(__input)
23953 };
23954 let mut __struct = Self::default();
23955 __struct.param_index = buf.get_i16_le()?;
23956 __struct.target_system = buf.get_u8()?;
23957 __struct.target_component = buf.get_u8()?;
23958 let mut tmp = [0_u8; 16usize];
23959 for v in &mut tmp {
23960 *v = buf.get_u8()?;
23961 }
23962 __struct.param_id = CharArray::new(tmp);
23963 Ok(__struct)
23964 }
23965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23966 let mut __tmp = BytesMut::new(bytes);
23967 #[allow(clippy::absurd_extreme_comparisons)]
23968 #[allow(unused_comparisons)]
23969 if __tmp.remaining() < Self::ENCODED_LEN {
23970 panic!(
23971 "buffer is too small (need {} bytes, but got {})",
23972 Self::ENCODED_LEN,
23973 __tmp.remaining(),
23974 )
23975 }
23976 __tmp.put_i16_le(self.param_index);
23977 __tmp.put_u8(self.target_system);
23978 __tmp.put_u8(self.target_component);
23979 for val in &self.param_id {
23980 __tmp.put_u8(*val);
23981 }
23982 if matches!(version, MavlinkVersion::V2) {
23983 let len = __tmp.len();
23984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23985 } else {
23986 __tmp.len()
23987 }
23988 }
23989}
23990#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23991#[doc = ""]
23992#[doc = "ID: 23"]
23993#[derive(Debug, Clone, PartialEq)]
23994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23996#[cfg_attr(feature = "ts", derive(TS))]
23997#[cfg_attr(feature = "ts", ts(export))]
23998pub struct PARAM_SET_DATA {
23999 #[doc = "Onboard parameter value"]
24000 pub param_value: f32,
24001 #[doc = "System ID"]
24002 pub target_system: u8,
24003 #[doc = "Component ID"]
24004 pub target_component: u8,
24005 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24006 #[cfg_attr(feature = "ts", ts(type = "string"))]
24007 pub param_id: CharArray<16>,
24008 #[doc = "Onboard parameter type."]
24009 pub param_type: MavParamType,
24010}
24011impl PARAM_SET_DATA {
24012 pub const ENCODED_LEN: usize = 23usize;
24013 pub const DEFAULT: Self = Self {
24014 param_value: 0.0_f32,
24015 target_system: 0_u8,
24016 target_component: 0_u8,
24017 param_id: CharArray::new([0_u8; 16usize]),
24018 param_type: MavParamType::DEFAULT,
24019 };
24020 #[cfg(feature = "arbitrary")]
24021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24022 use arbitrary::{Arbitrary, Unstructured};
24023 let mut buf = [0u8; 1024];
24024 rng.fill_bytes(&mut buf);
24025 let mut unstructured = Unstructured::new(&buf);
24026 Self::arbitrary(&mut unstructured).unwrap_or_default()
24027 }
24028}
24029impl Default for PARAM_SET_DATA {
24030 fn default() -> Self {
24031 Self::DEFAULT.clone()
24032 }
24033}
24034impl MessageData for PARAM_SET_DATA {
24035 type Message = MavMessage;
24036 const ID: u32 = 23u32;
24037 const NAME: &'static str = "PARAM_SET";
24038 const EXTRA_CRC: u8 = 168u8;
24039 const ENCODED_LEN: usize = 23usize;
24040 fn deser(
24041 _version: MavlinkVersion,
24042 __input: &[u8],
24043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24044 let avail_len = __input.len();
24045 let mut payload_buf = [0; Self::ENCODED_LEN];
24046 let mut buf = if avail_len < Self::ENCODED_LEN {
24047 payload_buf[0..avail_len].copy_from_slice(__input);
24048 Bytes::new(&payload_buf)
24049 } else {
24050 Bytes::new(__input)
24051 };
24052 let mut __struct = Self::default();
24053 __struct.param_value = buf.get_f32_le()?;
24054 __struct.target_system = buf.get_u8()?;
24055 __struct.target_component = buf.get_u8()?;
24056 let mut tmp = [0_u8; 16usize];
24057 for v in &mut tmp {
24058 *v = buf.get_u8()?;
24059 }
24060 __struct.param_id = CharArray::new(tmp);
24061 let tmp = buf.get_u8()?;
24062 __struct.param_type =
24063 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24064 enum_type: "MavParamType",
24065 value: tmp as u64,
24066 })?;
24067 Ok(__struct)
24068 }
24069 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24070 let mut __tmp = BytesMut::new(bytes);
24071 #[allow(clippy::absurd_extreme_comparisons)]
24072 #[allow(unused_comparisons)]
24073 if __tmp.remaining() < Self::ENCODED_LEN {
24074 panic!(
24075 "buffer is too small (need {} bytes, but got {})",
24076 Self::ENCODED_LEN,
24077 __tmp.remaining(),
24078 )
24079 }
24080 __tmp.put_f32_le(self.param_value);
24081 __tmp.put_u8(self.target_system);
24082 __tmp.put_u8(self.target_component);
24083 for val in &self.param_id {
24084 __tmp.put_u8(*val);
24085 }
24086 __tmp.put_u8(self.param_type as u8);
24087 if matches!(version, MavlinkVersion::V2) {
24088 let len = __tmp.len();
24089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24090 } else {
24091 __tmp.len()
24092 }
24093 }
24094}
24095#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24096#[doc = ""]
24097#[doc = "ID: 22"]
24098#[derive(Debug, Clone, PartialEq)]
24099#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24101#[cfg_attr(feature = "ts", derive(TS))]
24102#[cfg_attr(feature = "ts", ts(export))]
24103pub struct PARAM_VALUE_DATA {
24104 #[doc = "Onboard parameter value"]
24105 pub param_value: f32,
24106 #[doc = "Total number of onboard parameters"]
24107 pub param_count: u16,
24108 #[doc = "Index of this onboard parameter"]
24109 pub param_index: u16,
24110 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24111 #[cfg_attr(feature = "ts", ts(type = "string"))]
24112 pub param_id: CharArray<16>,
24113 #[doc = "Onboard parameter type."]
24114 pub param_type: MavParamType,
24115}
24116impl PARAM_VALUE_DATA {
24117 pub const ENCODED_LEN: usize = 25usize;
24118 pub const DEFAULT: Self = Self {
24119 param_value: 0.0_f32,
24120 param_count: 0_u16,
24121 param_index: 0_u16,
24122 param_id: CharArray::new([0_u8; 16usize]),
24123 param_type: MavParamType::DEFAULT,
24124 };
24125 #[cfg(feature = "arbitrary")]
24126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24127 use arbitrary::{Arbitrary, Unstructured};
24128 let mut buf = [0u8; 1024];
24129 rng.fill_bytes(&mut buf);
24130 let mut unstructured = Unstructured::new(&buf);
24131 Self::arbitrary(&mut unstructured).unwrap_or_default()
24132 }
24133}
24134impl Default for PARAM_VALUE_DATA {
24135 fn default() -> Self {
24136 Self::DEFAULT.clone()
24137 }
24138}
24139impl MessageData for PARAM_VALUE_DATA {
24140 type Message = MavMessage;
24141 const ID: u32 = 22u32;
24142 const NAME: &'static str = "PARAM_VALUE";
24143 const EXTRA_CRC: u8 = 220u8;
24144 const ENCODED_LEN: usize = 25usize;
24145 fn deser(
24146 _version: MavlinkVersion,
24147 __input: &[u8],
24148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24149 let avail_len = __input.len();
24150 let mut payload_buf = [0; Self::ENCODED_LEN];
24151 let mut buf = if avail_len < Self::ENCODED_LEN {
24152 payload_buf[0..avail_len].copy_from_slice(__input);
24153 Bytes::new(&payload_buf)
24154 } else {
24155 Bytes::new(__input)
24156 };
24157 let mut __struct = Self::default();
24158 __struct.param_value = buf.get_f32_le()?;
24159 __struct.param_count = buf.get_u16_le()?;
24160 __struct.param_index = buf.get_u16_le()?;
24161 let mut tmp = [0_u8; 16usize];
24162 for v in &mut tmp {
24163 *v = buf.get_u8()?;
24164 }
24165 __struct.param_id = CharArray::new(tmp);
24166 let tmp = buf.get_u8()?;
24167 __struct.param_type =
24168 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24169 enum_type: "MavParamType",
24170 value: tmp as u64,
24171 })?;
24172 Ok(__struct)
24173 }
24174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24175 let mut __tmp = BytesMut::new(bytes);
24176 #[allow(clippy::absurd_extreme_comparisons)]
24177 #[allow(unused_comparisons)]
24178 if __tmp.remaining() < Self::ENCODED_LEN {
24179 panic!(
24180 "buffer is too small (need {} bytes, but got {})",
24181 Self::ENCODED_LEN,
24182 __tmp.remaining(),
24183 )
24184 }
24185 __tmp.put_f32_le(self.param_value);
24186 __tmp.put_u16_le(self.param_count);
24187 __tmp.put_u16_le(self.param_index);
24188 for val in &self.param_id {
24189 __tmp.put_u8(*val);
24190 }
24191 __tmp.put_u8(self.param_type as u8);
24192 if matches!(version, MavlinkVersion::V2) {
24193 let len = __tmp.len();
24194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24195 } else {
24196 __tmp.len()
24197 }
24198 }
24199}
24200#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24201#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24202#[doc = ""]
24203#[doc = "ID: 4"]
24204#[derive(Debug, Clone, PartialEq)]
24205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24207#[cfg_attr(feature = "ts", derive(TS))]
24208#[cfg_attr(feature = "ts", ts(export))]
24209pub struct PING_DATA {
24210 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24211 pub time_usec: u64,
24212 #[doc = "PING sequence"]
24213 pub seq: u32,
24214 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24215 pub target_system: u8,
24216 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24217 pub target_component: u8,
24218}
24219impl PING_DATA {
24220 pub const ENCODED_LEN: usize = 14usize;
24221 pub const DEFAULT: Self = Self {
24222 time_usec: 0_u64,
24223 seq: 0_u32,
24224 target_system: 0_u8,
24225 target_component: 0_u8,
24226 };
24227 #[cfg(feature = "arbitrary")]
24228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24229 use arbitrary::{Arbitrary, Unstructured};
24230 let mut buf = [0u8; 1024];
24231 rng.fill_bytes(&mut buf);
24232 let mut unstructured = Unstructured::new(&buf);
24233 Self::arbitrary(&mut unstructured).unwrap_or_default()
24234 }
24235}
24236impl Default for PING_DATA {
24237 fn default() -> Self {
24238 Self::DEFAULT.clone()
24239 }
24240}
24241impl MessageData for PING_DATA {
24242 type Message = MavMessage;
24243 const ID: u32 = 4u32;
24244 const NAME: &'static str = "PING";
24245 const EXTRA_CRC: u8 = 237u8;
24246 const ENCODED_LEN: usize = 14usize;
24247 fn deser(
24248 _version: MavlinkVersion,
24249 __input: &[u8],
24250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24251 let avail_len = __input.len();
24252 let mut payload_buf = [0; Self::ENCODED_LEN];
24253 let mut buf = if avail_len < Self::ENCODED_LEN {
24254 payload_buf[0..avail_len].copy_from_slice(__input);
24255 Bytes::new(&payload_buf)
24256 } else {
24257 Bytes::new(__input)
24258 };
24259 let mut __struct = Self::default();
24260 __struct.time_usec = buf.get_u64_le()?;
24261 __struct.seq = buf.get_u32_le()?;
24262 __struct.target_system = buf.get_u8()?;
24263 __struct.target_component = buf.get_u8()?;
24264 Ok(__struct)
24265 }
24266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24267 let mut __tmp = BytesMut::new(bytes);
24268 #[allow(clippy::absurd_extreme_comparisons)]
24269 #[allow(unused_comparisons)]
24270 if __tmp.remaining() < Self::ENCODED_LEN {
24271 panic!(
24272 "buffer is too small (need {} bytes, but got {})",
24273 Self::ENCODED_LEN,
24274 __tmp.remaining(),
24275 )
24276 }
24277 __tmp.put_u64_le(self.time_usec);
24278 __tmp.put_u32_le(self.seq);
24279 __tmp.put_u8(self.target_system);
24280 __tmp.put_u8(self.target_component);
24281 if matches!(version, MavlinkVersion::V2) {
24282 let len = __tmp.len();
24283 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24284 } else {
24285 __tmp.len()
24286 }
24287 }
24288}
24289#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24290#[doc = "Control vehicle tone generation (buzzer)."]
24291#[doc = ""]
24292#[doc = "ID: 258"]
24293#[derive(Debug, Clone, PartialEq)]
24294#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24296#[cfg_attr(feature = "ts", derive(TS))]
24297#[cfg_attr(feature = "ts", ts(export))]
24298pub struct PLAY_TUNE_DATA {
24299 #[doc = "System ID"]
24300 pub target_system: u8,
24301 #[doc = "Component ID"]
24302 pub target_component: u8,
24303 #[doc = "tune in board specific format"]
24304 #[cfg_attr(feature = "ts", ts(type = "string"))]
24305 pub tune: CharArray<30>,
24306 #[doc = "tune extension (appended to tune)"]
24307 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24308 #[cfg_attr(feature = "ts", ts(type = "string"))]
24309 pub tune2: CharArray<200>,
24310}
24311impl PLAY_TUNE_DATA {
24312 pub const ENCODED_LEN: usize = 232usize;
24313 pub const DEFAULT: Self = Self {
24314 target_system: 0_u8,
24315 target_component: 0_u8,
24316 tune: CharArray::new([0_u8; 30usize]),
24317 tune2: CharArray::new([0_u8; 200usize]),
24318 };
24319 #[cfg(feature = "arbitrary")]
24320 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24321 use arbitrary::{Arbitrary, Unstructured};
24322 let mut buf = [0u8; 1024];
24323 rng.fill_bytes(&mut buf);
24324 let mut unstructured = Unstructured::new(&buf);
24325 Self::arbitrary(&mut unstructured).unwrap_or_default()
24326 }
24327}
24328impl Default for PLAY_TUNE_DATA {
24329 fn default() -> Self {
24330 Self::DEFAULT.clone()
24331 }
24332}
24333impl MessageData for PLAY_TUNE_DATA {
24334 type Message = MavMessage;
24335 const ID: u32 = 258u32;
24336 const NAME: &'static str = "PLAY_TUNE";
24337 const EXTRA_CRC: u8 = 187u8;
24338 const ENCODED_LEN: usize = 232usize;
24339 fn deser(
24340 _version: MavlinkVersion,
24341 __input: &[u8],
24342 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24343 let avail_len = __input.len();
24344 let mut payload_buf = [0; Self::ENCODED_LEN];
24345 let mut buf = if avail_len < Self::ENCODED_LEN {
24346 payload_buf[0..avail_len].copy_from_slice(__input);
24347 Bytes::new(&payload_buf)
24348 } else {
24349 Bytes::new(__input)
24350 };
24351 let mut __struct = Self::default();
24352 __struct.target_system = buf.get_u8()?;
24353 __struct.target_component = buf.get_u8()?;
24354 let mut tmp = [0_u8; 30usize];
24355 for v in &mut tmp {
24356 *v = buf.get_u8()?;
24357 }
24358 __struct.tune = CharArray::new(tmp);
24359 let mut tmp = [0_u8; 200usize];
24360 for v in &mut tmp {
24361 *v = buf.get_u8()?;
24362 }
24363 __struct.tune2 = CharArray::new(tmp);
24364 Ok(__struct)
24365 }
24366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24367 let mut __tmp = BytesMut::new(bytes);
24368 #[allow(clippy::absurd_extreme_comparisons)]
24369 #[allow(unused_comparisons)]
24370 if __tmp.remaining() < Self::ENCODED_LEN {
24371 panic!(
24372 "buffer is too small (need {} bytes, but got {})",
24373 Self::ENCODED_LEN,
24374 __tmp.remaining(),
24375 )
24376 }
24377 __tmp.put_u8(self.target_system);
24378 __tmp.put_u8(self.target_component);
24379 for val in &self.tune {
24380 __tmp.put_u8(*val);
24381 }
24382 if matches!(version, MavlinkVersion::V2) {
24383 for val in &self.tune2 {
24384 __tmp.put_u8(*val);
24385 }
24386 let len = __tmp.len();
24387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24388 } else {
24389 __tmp.len()
24390 }
24391 }
24392}
24393#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24394#[doc = ""]
24395#[doc = "ID: 400"]
24396#[derive(Debug, Clone, PartialEq)]
24397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24399#[cfg_attr(feature = "ts", derive(TS))]
24400#[cfg_attr(feature = "ts", ts(export))]
24401pub struct PLAY_TUNE_V2_DATA {
24402 #[doc = "Tune format"]
24403 pub format: TuneFormat,
24404 #[doc = "System ID"]
24405 pub target_system: u8,
24406 #[doc = "Component ID"]
24407 pub target_component: u8,
24408 #[doc = "Tune definition as a NULL-terminated string."]
24409 #[cfg_attr(feature = "ts", ts(type = "string"))]
24410 pub tune: CharArray<248>,
24411}
24412impl PLAY_TUNE_V2_DATA {
24413 pub const ENCODED_LEN: usize = 254usize;
24414 pub const DEFAULT: Self = Self {
24415 format: TuneFormat::DEFAULT,
24416 target_system: 0_u8,
24417 target_component: 0_u8,
24418 tune: CharArray::new([0_u8; 248usize]),
24419 };
24420 #[cfg(feature = "arbitrary")]
24421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24422 use arbitrary::{Arbitrary, Unstructured};
24423 let mut buf = [0u8; 1024];
24424 rng.fill_bytes(&mut buf);
24425 let mut unstructured = Unstructured::new(&buf);
24426 Self::arbitrary(&mut unstructured).unwrap_or_default()
24427 }
24428}
24429impl Default for PLAY_TUNE_V2_DATA {
24430 fn default() -> Self {
24431 Self::DEFAULT.clone()
24432 }
24433}
24434impl MessageData for PLAY_TUNE_V2_DATA {
24435 type Message = MavMessage;
24436 const ID: u32 = 400u32;
24437 const NAME: &'static str = "PLAY_TUNE_V2";
24438 const EXTRA_CRC: u8 = 110u8;
24439 const ENCODED_LEN: usize = 254usize;
24440 fn deser(
24441 _version: MavlinkVersion,
24442 __input: &[u8],
24443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24444 let avail_len = __input.len();
24445 let mut payload_buf = [0; Self::ENCODED_LEN];
24446 let mut buf = if avail_len < Self::ENCODED_LEN {
24447 payload_buf[0..avail_len].copy_from_slice(__input);
24448 Bytes::new(&payload_buf)
24449 } else {
24450 Bytes::new(__input)
24451 };
24452 let mut __struct = Self::default();
24453 let tmp = buf.get_u32_le()?;
24454 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24455 ::mavlink_core::error::ParserError::InvalidEnum {
24456 enum_type: "TuneFormat",
24457 value: tmp as u64,
24458 },
24459 )?;
24460 __struct.target_system = buf.get_u8()?;
24461 __struct.target_component = buf.get_u8()?;
24462 let mut tmp = [0_u8; 248usize];
24463 for v in &mut tmp {
24464 *v = buf.get_u8()?;
24465 }
24466 __struct.tune = CharArray::new(tmp);
24467 Ok(__struct)
24468 }
24469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24470 let mut __tmp = BytesMut::new(bytes);
24471 #[allow(clippy::absurd_extreme_comparisons)]
24472 #[allow(unused_comparisons)]
24473 if __tmp.remaining() < Self::ENCODED_LEN {
24474 panic!(
24475 "buffer is too small (need {} bytes, but got {})",
24476 Self::ENCODED_LEN,
24477 __tmp.remaining(),
24478 )
24479 }
24480 __tmp.put_u32_le(self.format as u32);
24481 __tmp.put_u8(self.target_system);
24482 __tmp.put_u8(self.target_component);
24483 for val in &self.tune {
24484 __tmp.put_u8(*val);
24485 }
24486 if matches!(version, MavlinkVersion::V2) {
24487 let len = __tmp.len();
24488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24489 } else {
24490 __tmp.len()
24491 }
24492 }
24493}
24494#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24495#[doc = ""]
24496#[doc = "ID: 87"]
24497#[derive(Debug, Clone, PartialEq)]
24498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24500#[cfg_attr(feature = "ts", derive(TS))]
24501#[cfg_attr(feature = "ts", ts(export))]
24502pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24503 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24504 pub time_boot_ms: u32,
24505 #[doc = "Latitude in WGS84 frame"]
24506 pub lat_int: i32,
24507 #[doc = "Longitude in WGS84 frame"]
24508 pub lon_int: i32,
24509 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24510 pub alt: f32,
24511 #[doc = "X velocity in NED frame"]
24512 pub vx: f32,
24513 #[doc = "Y velocity in NED frame"]
24514 pub vy: f32,
24515 #[doc = "Z velocity in NED frame"]
24516 pub vz: f32,
24517 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24518 pub afx: f32,
24519 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24520 pub afy: f32,
24521 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24522 pub afz: f32,
24523 #[doc = "yaw setpoint"]
24524 pub yaw: f32,
24525 #[doc = "yaw rate setpoint"]
24526 pub yaw_rate: f32,
24527 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24528 pub type_mask: PositionTargetTypemask,
24529 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24530 pub coordinate_frame: MavFrame,
24531}
24532impl POSITION_TARGET_GLOBAL_INT_DATA {
24533 pub const ENCODED_LEN: usize = 51usize;
24534 pub const DEFAULT: Self = Self {
24535 time_boot_ms: 0_u32,
24536 lat_int: 0_i32,
24537 lon_int: 0_i32,
24538 alt: 0.0_f32,
24539 vx: 0.0_f32,
24540 vy: 0.0_f32,
24541 vz: 0.0_f32,
24542 afx: 0.0_f32,
24543 afy: 0.0_f32,
24544 afz: 0.0_f32,
24545 yaw: 0.0_f32,
24546 yaw_rate: 0.0_f32,
24547 type_mask: PositionTargetTypemask::DEFAULT,
24548 coordinate_frame: MavFrame::DEFAULT,
24549 };
24550 #[cfg(feature = "arbitrary")]
24551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24552 use arbitrary::{Arbitrary, Unstructured};
24553 let mut buf = [0u8; 1024];
24554 rng.fill_bytes(&mut buf);
24555 let mut unstructured = Unstructured::new(&buf);
24556 Self::arbitrary(&mut unstructured).unwrap_or_default()
24557 }
24558}
24559impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24560 fn default() -> Self {
24561 Self::DEFAULT.clone()
24562 }
24563}
24564impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24565 type Message = MavMessage;
24566 const ID: u32 = 87u32;
24567 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24568 const EXTRA_CRC: u8 = 150u8;
24569 const ENCODED_LEN: usize = 51usize;
24570 fn deser(
24571 _version: MavlinkVersion,
24572 __input: &[u8],
24573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24574 let avail_len = __input.len();
24575 let mut payload_buf = [0; Self::ENCODED_LEN];
24576 let mut buf = if avail_len < Self::ENCODED_LEN {
24577 payload_buf[0..avail_len].copy_from_slice(__input);
24578 Bytes::new(&payload_buf)
24579 } else {
24580 Bytes::new(__input)
24581 };
24582 let mut __struct = Self::default();
24583 __struct.time_boot_ms = buf.get_u32_le()?;
24584 __struct.lat_int = buf.get_i32_le()?;
24585 __struct.lon_int = buf.get_i32_le()?;
24586 __struct.alt = buf.get_f32_le()?;
24587 __struct.vx = buf.get_f32_le()?;
24588 __struct.vy = buf.get_f32_le()?;
24589 __struct.vz = buf.get_f32_le()?;
24590 __struct.afx = buf.get_f32_le()?;
24591 __struct.afy = buf.get_f32_le()?;
24592 __struct.afz = buf.get_f32_le()?;
24593 __struct.yaw = buf.get_f32_le()?;
24594 __struct.yaw_rate = buf.get_f32_le()?;
24595 let tmp = buf.get_u16_le()?;
24596 __struct.type_mask =
24597 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24598 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24599 flag_type: "PositionTargetTypemask",
24600 value: tmp as u64,
24601 })?;
24602 let tmp = buf.get_u8()?;
24603 __struct.coordinate_frame =
24604 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24605 enum_type: "MavFrame",
24606 value: tmp as u64,
24607 })?;
24608 Ok(__struct)
24609 }
24610 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24611 let mut __tmp = BytesMut::new(bytes);
24612 #[allow(clippy::absurd_extreme_comparisons)]
24613 #[allow(unused_comparisons)]
24614 if __tmp.remaining() < Self::ENCODED_LEN {
24615 panic!(
24616 "buffer is too small (need {} bytes, but got {})",
24617 Self::ENCODED_LEN,
24618 __tmp.remaining(),
24619 )
24620 }
24621 __tmp.put_u32_le(self.time_boot_ms);
24622 __tmp.put_i32_le(self.lat_int);
24623 __tmp.put_i32_le(self.lon_int);
24624 __tmp.put_f32_le(self.alt);
24625 __tmp.put_f32_le(self.vx);
24626 __tmp.put_f32_le(self.vy);
24627 __tmp.put_f32_le(self.vz);
24628 __tmp.put_f32_le(self.afx);
24629 __tmp.put_f32_le(self.afy);
24630 __tmp.put_f32_le(self.afz);
24631 __tmp.put_f32_le(self.yaw);
24632 __tmp.put_f32_le(self.yaw_rate);
24633 __tmp.put_u16_le(self.type_mask.bits() as u16);
24634 __tmp.put_u8(self.coordinate_frame as u8);
24635 if matches!(version, MavlinkVersion::V2) {
24636 let len = __tmp.len();
24637 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24638 } else {
24639 __tmp.len()
24640 }
24641 }
24642}
24643#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24644#[doc = ""]
24645#[doc = "ID: 85"]
24646#[derive(Debug, Clone, PartialEq)]
24647#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24649#[cfg_attr(feature = "ts", derive(TS))]
24650#[cfg_attr(feature = "ts", ts(export))]
24651pub struct POSITION_TARGET_LOCAL_NED_DATA {
24652 #[doc = "Timestamp (time since system boot)."]
24653 pub time_boot_ms: u32,
24654 #[doc = "X Position in NED frame"]
24655 pub x: f32,
24656 #[doc = "Y Position in NED frame"]
24657 pub y: f32,
24658 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24659 pub z: f32,
24660 #[doc = "X velocity in NED frame"]
24661 pub vx: f32,
24662 #[doc = "Y velocity in NED frame"]
24663 pub vy: f32,
24664 #[doc = "Z velocity in NED frame"]
24665 pub vz: f32,
24666 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24667 pub afx: f32,
24668 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24669 pub afy: f32,
24670 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24671 pub afz: f32,
24672 #[doc = "yaw setpoint"]
24673 pub yaw: f32,
24674 #[doc = "yaw rate setpoint"]
24675 pub yaw_rate: f32,
24676 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24677 pub type_mask: PositionTargetTypemask,
24678 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24679 pub coordinate_frame: MavFrame,
24680}
24681impl POSITION_TARGET_LOCAL_NED_DATA {
24682 pub const ENCODED_LEN: usize = 51usize;
24683 pub const DEFAULT: Self = Self {
24684 time_boot_ms: 0_u32,
24685 x: 0.0_f32,
24686 y: 0.0_f32,
24687 z: 0.0_f32,
24688 vx: 0.0_f32,
24689 vy: 0.0_f32,
24690 vz: 0.0_f32,
24691 afx: 0.0_f32,
24692 afy: 0.0_f32,
24693 afz: 0.0_f32,
24694 yaw: 0.0_f32,
24695 yaw_rate: 0.0_f32,
24696 type_mask: PositionTargetTypemask::DEFAULT,
24697 coordinate_frame: MavFrame::DEFAULT,
24698 };
24699 #[cfg(feature = "arbitrary")]
24700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24701 use arbitrary::{Arbitrary, Unstructured};
24702 let mut buf = [0u8; 1024];
24703 rng.fill_bytes(&mut buf);
24704 let mut unstructured = Unstructured::new(&buf);
24705 Self::arbitrary(&mut unstructured).unwrap_or_default()
24706 }
24707}
24708impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24709 fn default() -> Self {
24710 Self::DEFAULT.clone()
24711 }
24712}
24713impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24714 type Message = MavMessage;
24715 const ID: u32 = 85u32;
24716 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24717 const EXTRA_CRC: u8 = 140u8;
24718 const ENCODED_LEN: usize = 51usize;
24719 fn deser(
24720 _version: MavlinkVersion,
24721 __input: &[u8],
24722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24723 let avail_len = __input.len();
24724 let mut payload_buf = [0; Self::ENCODED_LEN];
24725 let mut buf = if avail_len < Self::ENCODED_LEN {
24726 payload_buf[0..avail_len].copy_from_slice(__input);
24727 Bytes::new(&payload_buf)
24728 } else {
24729 Bytes::new(__input)
24730 };
24731 let mut __struct = Self::default();
24732 __struct.time_boot_ms = buf.get_u32_le()?;
24733 __struct.x = buf.get_f32_le()?;
24734 __struct.y = buf.get_f32_le()?;
24735 __struct.z = buf.get_f32_le()?;
24736 __struct.vx = buf.get_f32_le()?;
24737 __struct.vy = buf.get_f32_le()?;
24738 __struct.vz = buf.get_f32_le()?;
24739 __struct.afx = buf.get_f32_le()?;
24740 __struct.afy = buf.get_f32_le()?;
24741 __struct.afz = buf.get_f32_le()?;
24742 __struct.yaw = buf.get_f32_le()?;
24743 __struct.yaw_rate = buf.get_f32_le()?;
24744 let tmp = buf.get_u16_le()?;
24745 __struct.type_mask =
24746 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
24747 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24748 flag_type: "PositionTargetTypemask",
24749 value: tmp as u64,
24750 })?;
24751 let tmp = buf.get_u8()?;
24752 __struct.coordinate_frame =
24753 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24754 enum_type: "MavFrame",
24755 value: tmp as u64,
24756 })?;
24757 Ok(__struct)
24758 }
24759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24760 let mut __tmp = BytesMut::new(bytes);
24761 #[allow(clippy::absurd_extreme_comparisons)]
24762 #[allow(unused_comparisons)]
24763 if __tmp.remaining() < Self::ENCODED_LEN {
24764 panic!(
24765 "buffer is too small (need {} bytes, but got {})",
24766 Self::ENCODED_LEN,
24767 __tmp.remaining(),
24768 )
24769 }
24770 __tmp.put_u32_le(self.time_boot_ms);
24771 __tmp.put_f32_le(self.x);
24772 __tmp.put_f32_le(self.y);
24773 __tmp.put_f32_le(self.z);
24774 __tmp.put_f32_le(self.vx);
24775 __tmp.put_f32_le(self.vy);
24776 __tmp.put_f32_le(self.vz);
24777 __tmp.put_f32_le(self.afx);
24778 __tmp.put_f32_le(self.afy);
24779 __tmp.put_f32_le(self.afz);
24780 __tmp.put_f32_le(self.yaw);
24781 __tmp.put_f32_le(self.yaw_rate);
24782 __tmp.put_u16_le(self.type_mask.bits() as u16);
24783 __tmp.put_u8(self.coordinate_frame as u8);
24784 if matches!(version, MavlinkVersion::V2) {
24785 let len = __tmp.len();
24786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24787 } else {
24788 __tmp.len()
24789 }
24790 }
24791}
24792#[doc = "Power supply status."]
24793#[doc = ""]
24794#[doc = "ID: 125"]
24795#[derive(Debug, Clone, PartialEq)]
24796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24798#[cfg_attr(feature = "ts", derive(TS))]
24799#[cfg_attr(feature = "ts", ts(export))]
24800pub struct POWER_STATUS_DATA {
24801 #[doc = "5V rail voltage."]
24802 pub Vcc: u16,
24803 #[doc = "Servo rail voltage."]
24804 pub Vservo: u16,
24805 #[doc = "Bitmap of power supply status flags."]
24806 pub flags: MavPowerStatus,
24807}
24808impl POWER_STATUS_DATA {
24809 pub const ENCODED_LEN: usize = 6usize;
24810 pub const DEFAULT: Self = Self {
24811 Vcc: 0_u16,
24812 Vservo: 0_u16,
24813 flags: MavPowerStatus::DEFAULT,
24814 };
24815 #[cfg(feature = "arbitrary")]
24816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24817 use arbitrary::{Arbitrary, Unstructured};
24818 let mut buf = [0u8; 1024];
24819 rng.fill_bytes(&mut buf);
24820 let mut unstructured = Unstructured::new(&buf);
24821 Self::arbitrary(&mut unstructured).unwrap_or_default()
24822 }
24823}
24824impl Default for POWER_STATUS_DATA {
24825 fn default() -> Self {
24826 Self::DEFAULT.clone()
24827 }
24828}
24829impl MessageData for POWER_STATUS_DATA {
24830 type Message = MavMessage;
24831 const ID: u32 = 125u32;
24832 const NAME: &'static str = "POWER_STATUS";
24833 const EXTRA_CRC: u8 = 203u8;
24834 const ENCODED_LEN: usize = 6usize;
24835 fn deser(
24836 _version: MavlinkVersion,
24837 __input: &[u8],
24838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24839 let avail_len = __input.len();
24840 let mut payload_buf = [0; Self::ENCODED_LEN];
24841 let mut buf = if avail_len < Self::ENCODED_LEN {
24842 payload_buf[0..avail_len].copy_from_slice(__input);
24843 Bytes::new(&payload_buf)
24844 } else {
24845 Bytes::new(__input)
24846 };
24847 let mut __struct = Self::default();
24848 __struct.Vcc = buf.get_u16_le()?;
24849 __struct.Vservo = buf.get_u16_le()?;
24850 let tmp = buf.get_u16_le()?;
24851 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
24852 ::mavlink_core::error::ParserError::InvalidFlag {
24853 flag_type: "MavPowerStatus",
24854 value: tmp as u64,
24855 },
24856 )?;
24857 Ok(__struct)
24858 }
24859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24860 let mut __tmp = BytesMut::new(bytes);
24861 #[allow(clippy::absurd_extreme_comparisons)]
24862 #[allow(unused_comparisons)]
24863 if __tmp.remaining() < Self::ENCODED_LEN {
24864 panic!(
24865 "buffer is too small (need {} bytes, but got {})",
24866 Self::ENCODED_LEN,
24867 __tmp.remaining(),
24868 )
24869 }
24870 __tmp.put_u16_le(self.Vcc);
24871 __tmp.put_u16_le(self.Vservo);
24872 __tmp.put_u16_le(self.flags.bits() as u16);
24873 if matches!(version, MavlinkVersion::V2) {
24874 let len = __tmp.len();
24875 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24876 } else {
24877 __tmp.len()
24878 }
24879 }
24880}
24881#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24882#[doc = ""]
24883#[doc = "ID: 300"]
24884#[derive(Debug, Clone, PartialEq)]
24885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24887#[cfg_attr(feature = "ts", derive(TS))]
24888#[cfg_attr(feature = "ts", ts(export))]
24889pub struct PROTOCOL_VERSION_DATA {
24890 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24891 pub version: u16,
24892 #[doc = "Minimum MAVLink version supported"]
24893 pub min_version: u16,
24894 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24895 pub max_version: u16,
24896 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24897 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24898 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24899 pub spec_version_hash: [u8; 8],
24900 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24901 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24902 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24903 pub library_version_hash: [u8; 8],
24904}
24905impl PROTOCOL_VERSION_DATA {
24906 pub const ENCODED_LEN: usize = 22usize;
24907 pub const DEFAULT: Self = Self {
24908 version: 0_u16,
24909 min_version: 0_u16,
24910 max_version: 0_u16,
24911 spec_version_hash: [0_u8; 8usize],
24912 library_version_hash: [0_u8; 8usize],
24913 };
24914 #[cfg(feature = "arbitrary")]
24915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24916 use arbitrary::{Arbitrary, Unstructured};
24917 let mut buf = [0u8; 1024];
24918 rng.fill_bytes(&mut buf);
24919 let mut unstructured = Unstructured::new(&buf);
24920 Self::arbitrary(&mut unstructured).unwrap_or_default()
24921 }
24922}
24923impl Default for PROTOCOL_VERSION_DATA {
24924 fn default() -> Self {
24925 Self::DEFAULT.clone()
24926 }
24927}
24928impl MessageData for PROTOCOL_VERSION_DATA {
24929 type Message = MavMessage;
24930 const ID: u32 = 300u32;
24931 const NAME: &'static str = "PROTOCOL_VERSION";
24932 const EXTRA_CRC: u8 = 217u8;
24933 const ENCODED_LEN: usize = 22usize;
24934 fn deser(
24935 _version: MavlinkVersion,
24936 __input: &[u8],
24937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24938 let avail_len = __input.len();
24939 let mut payload_buf = [0; Self::ENCODED_LEN];
24940 let mut buf = if avail_len < Self::ENCODED_LEN {
24941 payload_buf[0..avail_len].copy_from_slice(__input);
24942 Bytes::new(&payload_buf)
24943 } else {
24944 Bytes::new(__input)
24945 };
24946 let mut __struct = Self::default();
24947 __struct.version = buf.get_u16_le()?;
24948 __struct.min_version = buf.get_u16_le()?;
24949 __struct.max_version = buf.get_u16_le()?;
24950 for v in &mut __struct.spec_version_hash {
24951 let val = buf.get_u8()?;
24952 *v = val;
24953 }
24954 for v in &mut __struct.library_version_hash {
24955 let val = buf.get_u8()?;
24956 *v = val;
24957 }
24958 Ok(__struct)
24959 }
24960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24961 let mut __tmp = BytesMut::new(bytes);
24962 #[allow(clippy::absurd_extreme_comparisons)]
24963 #[allow(unused_comparisons)]
24964 if __tmp.remaining() < Self::ENCODED_LEN {
24965 panic!(
24966 "buffer is too small (need {} bytes, but got {})",
24967 Self::ENCODED_LEN,
24968 __tmp.remaining(),
24969 )
24970 }
24971 __tmp.put_u16_le(self.version);
24972 __tmp.put_u16_le(self.min_version);
24973 __tmp.put_u16_le(self.max_version);
24974 for val in &self.spec_version_hash {
24975 __tmp.put_u8(*val);
24976 }
24977 for val in &self.library_version_hash {
24978 __tmp.put_u8(*val);
24979 }
24980 if matches!(version, MavlinkVersion::V2) {
24981 let len = __tmp.len();
24982 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24983 } else {
24984 __tmp.len()
24985 }
24986 }
24987}
24988#[doc = "Status generated by radio and injected into MAVLink stream."]
24989#[doc = ""]
24990#[doc = "ID: 109"]
24991#[derive(Debug, Clone, PartialEq)]
24992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24994#[cfg_attr(feature = "ts", derive(TS))]
24995#[cfg_attr(feature = "ts", ts(export))]
24996pub struct RADIO_STATUS_DATA {
24997 #[doc = "Count of radio packet receive errors (since boot)."]
24998 pub rxerrors: u16,
24999 #[doc = "Count of error corrected radio packets (since boot)."]
25000 pub fixed: u16,
25001 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25002 pub rssi: u8,
25003 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25004 pub remrssi: u8,
25005 #[doc = "Remaining free transmitter buffer space."]
25006 pub txbuf: u8,
25007 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25008 pub noise: u8,
25009 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25010 pub remnoise: u8,
25011}
25012impl RADIO_STATUS_DATA {
25013 pub const ENCODED_LEN: usize = 9usize;
25014 pub const DEFAULT: Self = Self {
25015 rxerrors: 0_u16,
25016 fixed: 0_u16,
25017 rssi: 0_u8,
25018 remrssi: 0_u8,
25019 txbuf: 0_u8,
25020 noise: 0_u8,
25021 remnoise: 0_u8,
25022 };
25023 #[cfg(feature = "arbitrary")]
25024 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25025 use arbitrary::{Arbitrary, Unstructured};
25026 let mut buf = [0u8; 1024];
25027 rng.fill_bytes(&mut buf);
25028 let mut unstructured = Unstructured::new(&buf);
25029 Self::arbitrary(&mut unstructured).unwrap_or_default()
25030 }
25031}
25032impl Default for RADIO_STATUS_DATA {
25033 fn default() -> Self {
25034 Self::DEFAULT.clone()
25035 }
25036}
25037impl MessageData for RADIO_STATUS_DATA {
25038 type Message = MavMessage;
25039 const ID: u32 = 109u32;
25040 const NAME: &'static str = "RADIO_STATUS";
25041 const EXTRA_CRC: u8 = 185u8;
25042 const ENCODED_LEN: usize = 9usize;
25043 fn deser(
25044 _version: MavlinkVersion,
25045 __input: &[u8],
25046 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25047 let avail_len = __input.len();
25048 let mut payload_buf = [0; Self::ENCODED_LEN];
25049 let mut buf = if avail_len < Self::ENCODED_LEN {
25050 payload_buf[0..avail_len].copy_from_slice(__input);
25051 Bytes::new(&payload_buf)
25052 } else {
25053 Bytes::new(__input)
25054 };
25055 let mut __struct = Self::default();
25056 __struct.rxerrors = buf.get_u16_le()?;
25057 __struct.fixed = buf.get_u16_le()?;
25058 __struct.rssi = buf.get_u8()?;
25059 __struct.remrssi = buf.get_u8()?;
25060 __struct.txbuf = buf.get_u8()?;
25061 __struct.noise = buf.get_u8()?;
25062 __struct.remnoise = buf.get_u8()?;
25063 Ok(__struct)
25064 }
25065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25066 let mut __tmp = BytesMut::new(bytes);
25067 #[allow(clippy::absurd_extreme_comparisons)]
25068 #[allow(unused_comparisons)]
25069 if __tmp.remaining() < Self::ENCODED_LEN {
25070 panic!(
25071 "buffer is too small (need {} bytes, but got {})",
25072 Self::ENCODED_LEN,
25073 __tmp.remaining(),
25074 )
25075 }
25076 __tmp.put_u16_le(self.rxerrors);
25077 __tmp.put_u16_le(self.fixed);
25078 __tmp.put_u8(self.rssi);
25079 __tmp.put_u8(self.remrssi);
25080 __tmp.put_u8(self.txbuf);
25081 __tmp.put_u8(self.noise);
25082 __tmp.put_u8(self.remnoise);
25083 if matches!(version, MavlinkVersion::V2) {
25084 let len = __tmp.len();
25085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25086 } else {
25087 __tmp.len()
25088 }
25089 }
25090}
25091#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25092#[doc = ""]
25093#[doc = "ID: 27"]
25094#[derive(Debug, Clone, PartialEq)]
25095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25097#[cfg_attr(feature = "ts", derive(TS))]
25098#[cfg_attr(feature = "ts", ts(export))]
25099pub struct RAW_IMU_DATA {
25100 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25101 pub time_usec: u64,
25102 #[doc = "X acceleration (raw)"]
25103 pub xacc: i16,
25104 #[doc = "Y acceleration (raw)"]
25105 pub yacc: i16,
25106 #[doc = "Z acceleration (raw)"]
25107 pub zacc: i16,
25108 #[doc = "Angular speed around X axis (raw)"]
25109 pub xgyro: i16,
25110 #[doc = "Angular speed around Y axis (raw)"]
25111 pub ygyro: i16,
25112 #[doc = "Angular speed around Z axis (raw)"]
25113 pub zgyro: i16,
25114 #[doc = "X Magnetic field (raw)"]
25115 pub xmag: i16,
25116 #[doc = "Y Magnetic field (raw)"]
25117 pub ymag: i16,
25118 #[doc = "Z Magnetic field (raw)"]
25119 pub zmag: i16,
25120 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25121 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25122 pub id: u8,
25123 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25124 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25125 pub temperature: i16,
25126}
25127impl RAW_IMU_DATA {
25128 pub const ENCODED_LEN: usize = 29usize;
25129 pub const DEFAULT: Self = Self {
25130 time_usec: 0_u64,
25131 xacc: 0_i16,
25132 yacc: 0_i16,
25133 zacc: 0_i16,
25134 xgyro: 0_i16,
25135 ygyro: 0_i16,
25136 zgyro: 0_i16,
25137 xmag: 0_i16,
25138 ymag: 0_i16,
25139 zmag: 0_i16,
25140 id: 0_u8,
25141 temperature: 0_i16,
25142 };
25143 #[cfg(feature = "arbitrary")]
25144 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25145 use arbitrary::{Arbitrary, Unstructured};
25146 let mut buf = [0u8; 1024];
25147 rng.fill_bytes(&mut buf);
25148 let mut unstructured = Unstructured::new(&buf);
25149 Self::arbitrary(&mut unstructured).unwrap_or_default()
25150 }
25151}
25152impl Default for RAW_IMU_DATA {
25153 fn default() -> Self {
25154 Self::DEFAULT.clone()
25155 }
25156}
25157impl MessageData for RAW_IMU_DATA {
25158 type Message = MavMessage;
25159 const ID: u32 = 27u32;
25160 const NAME: &'static str = "RAW_IMU";
25161 const EXTRA_CRC: u8 = 144u8;
25162 const ENCODED_LEN: usize = 29usize;
25163 fn deser(
25164 _version: MavlinkVersion,
25165 __input: &[u8],
25166 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25167 let avail_len = __input.len();
25168 let mut payload_buf = [0; Self::ENCODED_LEN];
25169 let mut buf = if avail_len < Self::ENCODED_LEN {
25170 payload_buf[0..avail_len].copy_from_slice(__input);
25171 Bytes::new(&payload_buf)
25172 } else {
25173 Bytes::new(__input)
25174 };
25175 let mut __struct = Self::default();
25176 __struct.time_usec = buf.get_u64_le()?;
25177 __struct.xacc = buf.get_i16_le()?;
25178 __struct.yacc = buf.get_i16_le()?;
25179 __struct.zacc = buf.get_i16_le()?;
25180 __struct.xgyro = buf.get_i16_le()?;
25181 __struct.ygyro = buf.get_i16_le()?;
25182 __struct.zgyro = buf.get_i16_le()?;
25183 __struct.xmag = buf.get_i16_le()?;
25184 __struct.ymag = buf.get_i16_le()?;
25185 __struct.zmag = buf.get_i16_le()?;
25186 __struct.id = buf.get_u8()?;
25187 __struct.temperature = buf.get_i16_le()?;
25188 Ok(__struct)
25189 }
25190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25191 let mut __tmp = BytesMut::new(bytes);
25192 #[allow(clippy::absurd_extreme_comparisons)]
25193 #[allow(unused_comparisons)]
25194 if __tmp.remaining() < Self::ENCODED_LEN {
25195 panic!(
25196 "buffer is too small (need {} bytes, but got {})",
25197 Self::ENCODED_LEN,
25198 __tmp.remaining(),
25199 )
25200 }
25201 __tmp.put_u64_le(self.time_usec);
25202 __tmp.put_i16_le(self.xacc);
25203 __tmp.put_i16_le(self.yacc);
25204 __tmp.put_i16_le(self.zacc);
25205 __tmp.put_i16_le(self.xgyro);
25206 __tmp.put_i16_le(self.ygyro);
25207 __tmp.put_i16_le(self.zgyro);
25208 __tmp.put_i16_le(self.xmag);
25209 __tmp.put_i16_le(self.ymag);
25210 __tmp.put_i16_le(self.zmag);
25211 if matches!(version, MavlinkVersion::V2) {
25212 __tmp.put_u8(self.id);
25213 __tmp.put_i16_le(self.temperature);
25214 let len = __tmp.len();
25215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25216 } else {
25217 __tmp.len()
25218 }
25219 }
25220}
25221#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25222#[doc = ""]
25223#[doc = "ID: 28"]
25224#[derive(Debug, Clone, PartialEq)]
25225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25226#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25227#[cfg_attr(feature = "ts", derive(TS))]
25228#[cfg_attr(feature = "ts", ts(export))]
25229pub struct RAW_PRESSURE_DATA {
25230 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25231 pub time_usec: u64,
25232 #[doc = "Absolute pressure (raw)"]
25233 pub press_abs: i16,
25234 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25235 pub press_diff1: i16,
25236 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25237 pub press_diff2: i16,
25238 #[doc = "Raw Temperature measurement (raw)"]
25239 pub temperature: i16,
25240}
25241impl RAW_PRESSURE_DATA {
25242 pub const ENCODED_LEN: usize = 16usize;
25243 pub const DEFAULT: Self = Self {
25244 time_usec: 0_u64,
25245 press_abs: 0_i16,
25246 press_diff1: 0_i16,
25247 press_diff2: 0_i16,
25248 temperature: 0_i16,
25249 };
25250 #[cfg(feature = "arbitrary")]
25251 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25252 use arbitrary::{Arbitrary, Unstructured};
25253 let mut buf = [0u8; 1024];
25254 rng.fill_bytes(&mut buf);
25255 let mut unstructured = Unstructured::new(&buf);
25256 Self::arbitrary(&mut unstructured).unwrap_or_default()
25257 }
25258}
25259impl Default for RAW_PRESSURE_DATA {
25260 fn default() -> Self {
25261 Self::DEFAULT.clone()
25262 }
25263}
25264impl MessageData for RAW_PRESSURE_DATA {
25265 type Message = MavMessage;
25266 const ID: u32 = 28u32;
25267 const NAME: &'static str = "RAW_PRESSURE";
25268 const EXTRA_CRC: u8 = 67u8;
25269 const ENCODED_LEN: usize = 16usize;
25270 fn deser(
25271 _version: MavlinkVersion,
25272 __input: &[u8],
25273 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25274 let avail_len = __input.len();
25275 let mut payload_buf = [0; Self::ENCODED_LEN];
25276 let mut buf = if avail_len < Self::ENCODED_LEN {
25277 payload_buf[0..avail_len].copy_from_slice(__input);
25278 Bytes::new(&payload_buf)
25279 } else {
25280 Bytes::new(__input)
25281 };
25282 let mut __struct = Self::default();
25283 __struct.time_usec = buf.get_u64_le()?;
25284 __struct.press_abs = buf.get_i16_le()?;
25285 __struct.press_diff1 = buf.get_i16_le()?;
25286 __struct.press_diff2 = buf.get_i16_le()?;
25287 __struct.temperature = buf.get_i16_le()?;
25288 Ok(__struct)
25289 }
25290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25291 let mut __tmp = BytesMut::new(bytes);
25292 #[allow(clippy::absurd_extreme_comparisons)]
25293 #[allow(unused_comparisons)]
25294 if __tmp.remaining() < Self::ENCODED_LEN {
25295 panic!(
25296 "buffer is too small (need {} bytes, but got {})",
25297 Self::ENCODED_LEN,
25298 __tmp.remaining(),
25299 )
25300 }
25301 __tmp.put_u64_le(self.time_usec);
25302 __tmp.put_i16_le(self.press_abs);
25303 __tmp.put_i16_le(self.press_diff1);
25304 __tmp.put_i16_le(self.press_diff2);
25305 __tmp.put_i16_le(self.temperature);
25306 if matches!(version, MavlinkVersion::V2) {
25307 let len = __tmp.len();
25308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25309 } else {
25310 __tmp.len()
25311 }
25312 }
25313}
25314#[doc = "RPM sensor data message."]
25315#[doc = ""]
25316#[doc = "ID: 339"]
25317#[derive(Debug, Clone, PartialEq)]
25318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25320#[cfg_attr(feature = "ts", derive(TS))]
25321#[cfg_attr(feature = "ts", ts(export))]
25322pub struct RAW_RPM_DATA {
25323 #[doc = "Indicated rate"]
25324 pub frequency: f32,
25325 #[doc = "Index of this RPM sensor (0-indexed)"]
25326 pub index: u8,
25327}
25328impl RAW_RPM_DATA {
25329 pub const ENCODED_LEN: usize = 5usize;
25330 pub const DEFAULT: Self = Self {
25331 frequency: 0.0_f32,
25332 index: 0_u8,
25333 };
25334 #[cfg(feature = "arbitrary")]
25335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25336 use arbitrary::{Arbitrary, Unstructured};
25337 let mut buf = [0u8; 1024];
25338 rng.fill_bytes(&mut buf);
25339 let mut unstructured = Unstructured::new(&buf);
25340 Self::arbitrary(&mut unstructured).unwrap_or_default()
25341 }
25342}
25343impl Default for RAW_RPM_DATA {
25344 fn default() -> Self {
25345 Self::DEFAULT.clone()
25346 }
25347}
25348impl MessageData for RAW_RPM_DATA {
25349 type Message = MavMessage;
25350 const ID: u32 = 339u32;
25351 const NAME: &'static str = "RAW_RPM";
25352 const EXTRA_CRC: u8 = 199u8;
25353 const ENCODED_LEN: usize = 5usize;
25354 fn deser(
25355 _version: MavlinkVersion,
25356 __input: &[u8],
25357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25358 let avail_len = __input.len();
25359 let mut payload_buf = [0; Self::ENCODED_LEN];
25360 let mut buf = if avail_len < Self::ENCODED_LEN {
25361 payload_buf[0..avail_len].copy_from_slice(__input);
25362 Bytes::new(&payload_buf)
25363 } else {
25364 Bytes::new(__input)
25365 };
25366 let mut __struct = Self::default();
25367 __struct.frequency = buf.get_f32_le()?;
25368 __struct.index = buf.get_u8()?;
25369 Ok(__struct)
25370 }
25371 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25372 let mut __tmp = BytesMut::new(bytes);
25373 #[allow(clippy::absurd_extreme_comparisons)]
25374 #[allow(unused_comparisons)]
25375 if __tmp.remaining() < Self::ENCODED_LEN {
25376 panic!(
25377 "buffer is too small (need {} bytes, but got {})",
25378 Self::ENCODED_LEN,
25379 __tmp.remaining(),
25380 )
25381 }
25382 __tmp.put_f32_le(self.frequency);
25383 __tmp.put_u8(self.index);
25384 if matches!(version, MavlinkVersion::V2) {
25385 let len = __tmp.len();
25386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25387 } else {
25388 __tmp.len()
25389 }
25390 }
25391}
25392#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25393#[doc = ""]
25394#[doc = "ID: 65"]
25395#[derive(Debug, Clone, PartialEq)]
25396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25398#[cfg_attr(feature = "ts", derive(TS))]
25399#[cfg_attr(feature = "ts", ts(export))]
25400pub struct RC_CHANNELS_DATA {
25401 #[doc = "Timestamp (time since system boot)."]
25402 pub time_boot_ms: u32,
25403 #[doc = "RC channel 1 value."]
25404 pub chan1_raw: u16,
25405 #[doc = "RC channel 2 value."]
25406 pub chan2_raw: u16,
25407 #[doc = "RC channel 3 value."]
25408 pub chan3_raw: u16,
25409 #[doc = "RC channel 4 value."]
25410 pub chan4_raw: u16,
25411 #[doc = "RC channel 5 value."]
25412 pub chan5_raw: u16,
25413 #[doc = "RC channel 6 value."]
25414 pub chan6_raw: u16,
25415 #[doc = "RC channel 7 value."]
25416 pub chan7_raw: u16,
25417 #[doc = "RC channel 8 value."]
25418 pub chan8_raw: u16,
25419 #[doc = "RC channel 9 value."]
25420 pub chan9_raw: u16,
25421 #[doc = "RC channel 10 value."]
25422 pub chan10_raw: u16,
25423 #[doc = "RC channel 11 value."]
25424 pub chan11_raw: u16,
25425 #[doc = "RC channel 12 value."]
25426 pub chan12_raw: u16,
25427 #[doc = "RC channel 13 value."]
25428 pub chan13_raw: u16,
25429 #[doc = "RC channel 14 value."]
25430 pub chan14_raw: u16,
25431 #[doc = "RC channel 15 value."]
25432 pub chan15_raw: u16,
25433 #[doc = "RC channel 16 value."]
25434 pub chan16_raw: u16,
25435 #[doc = "RC channel 17 value."]
25436 pub chan17_raw: u16,
25437 #[doc = "RC channel 18 value."]
25438 pub chan18_raw: u16,
25439 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25440 pub chancount: u8,
25441 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25442 pub rssi: u8,
25443}
25444impl RC_CHANNELS_DATA {
25445 pub const ENCODED_LEN: usize = 42usize;
25446 pub const DEFAULT: Self = Self {
25447 time_boot_ms: 0_u32,
25448 chan1_raw: 0_u16,
25449 chan2_raw: 0_u16,
25450 chan3_raw: 0_u16,
25451 chan4_raw: 0_u16,
25452 chan5_raw: 0_u16,
25453 chan6_raw: 0_u16,
25454 chan7_raw: 0_u16,
25455 chan8_raw: 0_u16,
25456 chan9_raw: 0_u16,
25457 chan10_raw: 0_u16,
25458 chan11_raw: 0_u16,
25459 chan12_raw: 0_u16,
25460 chan13_raw: 0_u16,
25461 chan14_raw: 0_u16,
25462 chan15_raw: 0_u16,
25463 chan16_raw: 0_u16,
25464 chan17_raw: 0_u16,
25465 chan18_raw: 0_u16,
25466 chancount: 0_u8,
25467 rssi: 0_u8,
25468 };
25469 #[cfg(feature = "arbitrary")]
25470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25471 use arbitrary::{Arbitrary, Unstructured};
25472 let mut buf = [0u8; 1024];
25473 rng.fill_bytes(&mut buf);
25474 let mut unstructured = Unstructured::new(&buf);
25475 Self::arbitrary(&mut unstructured).unwrap_or_default()
25476 }
25477}
25478impl Default for RC_CHANNELS_DATA {
25479 fn default() -> Self {
25480 Self::DEFAULT.clone()
25481 }
25482}
25483impl MessageData for RC_CHANNELS_DATA {
25484 type Message = MavMessage;
25485 const ID: u32 = 65u32;
25486 const NAME: &'static str = "RC_CHANNELS";
25487 const EXTRA_CRC: u8 = 118u8;
25488 const ENCODED_LEN: usize = 42usize;
25489 fn deser(
25490 _version: MavlinkVersion,
25491 __input: &[u8],
25492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25493 let avail_len = __input.len();
25494 let mut payload_buf = [0; Self::ENCODED_LEN];
25495 let mut buf = if avail_len < Self::ENCODED_LEN {
25496 payload_buf[0..avail_len].copy_from_slice(__input);
25497 Bytes::new(&payload_buf)
25498 } else {
25499 Bytes::new(__input)
25500 };
25501 let mut __struct = Self::default();
25502 __struct.time_boot_ms = buf.get_u32_le()?;
25503 __struct.chan1_raw = buf.get_u16_le()?;
25504 __struct.chan2_raw = buf.get_u16_le()?;
25505 __struct.chan3_raw = buf.get_u16_le()?;
25506 __struct.chan4_raw = buf.get_u16_le()?;
25507 __struct.chan5_raw = buf.get_u16_le()?;
25508 __struct.chan6_raw = buf.get_u16_le()?;
25509 __struct.chan7_raw = buf.get_u16_le()?;
25510 __struct.chan8_raw = buf.get_u16_le()?;
25511 __struct.chan9_raw = buf.get_u16_le()?;
25512 __struct.chan10_raw = buf.get_u16_le()?;
25513 __struct.chan11_raw = buf.get_u16_le()?;
25514 __struct.chan12_raw = buf.get_u16_le()?;
25515 __struct.chan13_raw = buf.get_u16_le()?;
25516 __struct.chan14_raw = buf.get_u16_le()?;
25517 __struct.chan15_raw = buf.get_u16_le()?;
25518 __struct.chan16_raw = buf.get_u16_le()?;
25519 __struct.chan17_raw = buf.get_u16_le()?;
25520 __struct.chan18_raw = buf.get_u16_le()?;
25521 __struct.chancount = buf.get_u8()?;
25522 __struct.rssi = buf.get_u8()?;
25523 Ok(__struct)
25524 }
25525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25526 let mut __tmp = BytesMut::new(bytes);
25527 #[allow(clippy::absurd_extreme_comparisons)]
25528 #[allow(unused_comparisons)]
25529 if __tmp.remaining() < Self::ENCODED_LEN {
25530 panic!(
25531 "buffer is too small (need {} bytes, but got {})",
25532 Self::ENCODED_LEN,
25533 __tmp.remaining(),
25534 )
25535 }
25536 __tmp.put_u32_le(self.time_boot_ms);
25537 __tmp.put_u16_le(self.chan1_raw);
25538 __tmp.put_u16_le(self.chan2_raw);
25539 __tmp.put_u16_le(self.chan3_raw);
25540 __tmp.put_u16_le(self.chan4_raw);
25541 __tmp.put_u16_le(self.chan5_raw);
25542 __tmp.put_u16_le(self.chan6_raw);
25543 __tmp.put_u16_le(self.chan7_raw);
25544 __tmp.put_u16_le(self.chan8_raw);
25545 __tmp.put_u16_le(self.chan9_raw);
25546 __tmp.put_u16_le(self.chan10_raw);
25547 __tmp.put_u16_le(self.chan11_raw);
25548 __tmp.put_u16_le(self.chan12_raw);
25549 __tmp.put_u16_le(self.chan13_raw);
25550 __tmp.put_u16_le(self.chan14_raw);
25551 __tmp.put_u16_le(self.chan15_raw);
25552 __tmp.put_u16_le(self.chan16_raw);
25553 __tmp.put_u16_le(self.chan17_raw);
25554 __tmp.put_u16_le(self.chan18_raw);
25555 __tmp.put_u8(self.chancount);
25556 __tmp.put_u8(self.rssi);
25557 if matches!(version, MavlinkVersion::V2) {
25558 let len = __tmp.len();
25559 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25560 } else {
25561 __tmp.len()
25562 }
25563 }
25564}
25565#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25566#[doc = ""]
25567#[doc = "ID: 70"]
25568#[derive(Debug, Clone, PartialEq)]
25569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25571#[cfg_attr(feature = "ts", derive(TS))]
25572#[cfg_attr(feature = "ts", ts(export))]
25573pub struct RC_CHANNELS_OVERRIDE_DATA {
25574 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25575 pub chan1_raw: u16,
25576 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25577 pub chan2_raw: u16,
25578 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25579 pub chan3_raw: u16,
25580 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25581 pub chan4_raw: u16,
25582 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25583 pub chan5_raw: u16,
25584 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25585 pub chan6_raw: u16,
25586 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25587 pub chan7_raw: u16,
25588 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25589 pub chan8_raw: u16,
25590 #[doc = "System ID"]
25591 pub target_system: u8,
25592 #[doc = "Component ID"]
25593 pub target_component: u8,
25594 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25595 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25596 pub chan9_raw: u16,
25597 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25598 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25599 pub chan10_raw: u16,
25600 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25601 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25602 pub chan11_raw: u16,
25603 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25604 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25605 pub chan12_raw: u16,
25606 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25607 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25608 pub chan13_raw: u16,
25609 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25611 pub chan14_raw: u16,
25612 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25613 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25614 pub chan15_raw: u16,
25615 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25616 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25617 pub chan16_raw: u16,
25618 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25619 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25620 pub chan17_raw: u16,
25621 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25622 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25623 pub chan18_raw: u16,
25624}
25625impl RC_CHANNELS_OVERRIDE_DATA {
25626 pub const ENCODED_LEN: usize = 38usize;
25627 pub const DEFAULT: Self = Self {
25628 chan1_raw: 0_u16,
25629 chan2_raw: 0_u16,
25630 chan3_raw: 0_u16,
25631 chan4_raw: 0_u16,
25632 chan5_raw: 0_u16,
25633 chan6_raw: 0_u16,
25634 chan7_raw: 0_u16,
25635 chan8_raw: 0_u16,
25636 target_system: 0_u8,
25637 target_component: 0_u8,
25638 chan9_raw: 0_u16,
25639 chan10_raw: 0_u16,
25640 chan11_raw: 0_u16,
25641 chan12_raw: 0_u16,
25642 chan13_raw: 0_u16,
25643 chan14_raw: 0_u16,
25644 chan15_raw: 0_u16,
25645 chan16_raw: 0_u16,
25646 chan17_raw: 0_u16,
25647 chan18_raw: 0_u16,
25648 };
25649 #[cfg(feature = "arbitrary")]
25650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25651 use arbitrary::{Arbitrary, Unstructured};
25652 let mut buf = [0u8; 1024];
25653 rng.fill_bytes(&mut buf);
25654 let mut unstructured = Unstructured::new(&buf);
25655 Self::arbitrary(&mut unstructured).unwrap_or_default()
25656 }
25657}
25658impl Default for RC_CHANNELS_OVERRIDE_DATA {
25659 fn default() -> Self {
25660 Self::DEFAULT.clone()
25661 }
25662}
25663impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25664 type Message = MavMessage;
25665 const ID: u32 = 70u32;
25666 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25667 const EXTRA_CRC: u8 = 124u8;
25668 const ENCODED_LEN: usize = 38usize;
25669 fn deser(
25670 _version: MavlinkVersion,
25671 __input: &[u8],
25672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25673 let avail_len = __input.len();
25674 let mut payload_buf = [0; Self::ENCODED_LEN];
25675 let mut buf = if avail_len < Self::ENCODED_LEN {
25676 payload_buf[0..avail_len].copy_from_slice(__input);
25677 Bytes::new(&payload_buf)
25678 } else {
25679 Bytes::new(__input)
25680 };
25681 let mut __struct = Self::default();
25682 __struct.chan1_raw = buf.get_u16_le()?;
25683 __struct.chan2_raw = buf.get_u16_le()?;
25684 __struct.chan3_raw = buf.get_u16_le()?;
25685 __struct.chan4_raw = buf.get_u16_le()?;
25686 __struct.chan5_raw = buf.get_u16_le()?;
25687 __struct.chan6_raw = buf.get_u16_le()?;
25688 __struct.chan7_raw = buf.get_u16_le()?;
25689 __struct.chan8_raw = buf.get_u16_le()?;
25690 __struct.target_system = buf.get_u8()?;
25691 __struct.target_component = buf.get_u8()?;
25692 __struct.chan9_raw = buf.get_u16_le()?;
25693 __struct.chan10_raw = buf.get_u16_le()?;
25694 __struct.chan11_raw = buf.get_u16_le()?;
25695 __struct.chan12_raw = buf.get_u16_le()?;
25696 __struct.chan13_raw = buf.get_u16_le()?;
25697 __struct.chan14_raw = buf.get_u16_le()?;
25698 __struct.chan15_raw = buf.get_u16_le()?;
25699 __struct.chan16_raw = buf.get_u16_le()?;
25700 __struct.chan17_raw = buf.get_u16_le()?;
25701 __struct.chan18_raw = buf.get_u16_le()?;
25702 Ok(__struct)
25703 }
25704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25705 let mut __tmp = BytesMut::new(bytes);
25706 #[allow(clippy::absurd_extreme_comparisons)]
25707 #[allow(unused_comparisons)]
25708 if __tmp.remaining() < Self::ENCODED_LEN {
25709 panic!(
25710 "buffer is too small (need {} bytes, but got {})",
25711 Self::ENCODED_LEN,
25712 __tmp.remaining(),
25713 )
25714 }
25715 __tmp.put_u16_le(self.chan1_raw);
25716 __tmp.put_u16_le(self.chan2_raw);
25717 __tmp.put_u16_le(self.chan3_raw);
25718 __tmp.put_u16_le(self.chan4_raw);
25719 __tmp.put_u16_le(self.chan5_raw);
25720 __tmp.put_u16_le(self.chan6_raw);
25721 __tmp.put_u16_le(self.chan7_raw);
25722 __tmp.put_u16_le(self.chan8_raw);
25723 __tmp.put_u8(self.target_system);
25724 __tmp.put_u8(self.target_component);
25725 if matches!(version, MavlinkVersion::V2) {
25726 __tmp.put_u16_le(self.chan9_raw);
25727 __tmp.put_u16_le(self.chan10_raw);
25728 __tmp.put_u16_le(self.chan11_raw);
25729 __tmp.put_u16_le(self.chan12_raw);
25730 __tmp.put_u16_le(self.chan13_raw);
25731 __tmp.put_u16_le(self.chan14_raw);
25732 __tmp.put_u16_le(self.chan15_raw);
25733 __tmp.put_u16_le(self.chan16_raw);
25734 __tmp.put_u16_le(self.chan17_raw);
25735 __tmp.put_u16_le(self.chan18_raw);
25736 let len = __tmp.len();
25737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25738 } else {
25739 __tmp.len()
25740 }
25741 }
25742}
25743#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25744#[doc = ""]
25745#[doc = "ID: 35"]
25746#[derive(Debug, Clone, PartialEq)]
25747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25749#[cfg_attr(feature = "ts", derive(TS))]
25750#[cfg_attr(feature = "ts", ts(export))]
25751pub struct RC_CHANNELS_RAW_DATA {
25752 #[doc = "Timestamp (time since system boot)."]
25753 pub time_boot_ms: u32,
25754 #[doc = "RC channel 1 value."]
25755 pub chan1_raw: u16,
25756 #[doc = "RC channel 2 value."]
25757 pub chan2_raw: u16,
25758 #[doc = "RC channel 3 value."]
25759 pub chan3_raw: u16,
25760 #[doc = "RC channel 4 value."]
25761 pub chan4_raw: u16,
25762 #[doc = "RC channel 5 value."]
25763 pub chan5_raw: u16,
25764 #[doc = "RC channel 6 value."]
25765 pub chan6_raw: u16,
25766 #[doc = "RC channel 7 value."]
25767 pub chan7_raw: u16,
25768 #[doc = "RC channel 8 value."]
25769 pub chan8_raw: u16,
25770 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25771 pub port: u8,
25772 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25773 pub rssi: u8,
25774}
25775impl RC_CHANNELS_RAW_DATA {
25776 pub const ENCODED_LEN: usize = 22usize;
25777 pub const DEFAULT: Self = Self {
25778 time_boot_ms: 0_u32,
25779 chan1_raw: 0_u16,
25780 chan2_raw: 0_u16,
25781 chan3_raw: 0_u16,
25782 chan4_raw: 0_u16,
25783 chan5_raw: 0_u16,
25784 chan6_raw: 0_u16,
25785 chan7_raw: 0_u16,
25786 chan8_raw: 0_u16,
25787 port: 0_u8,
25788 rssi: 0_u8,
25789 };
25790 #[cfg(feature = "arbitrary")]
25791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25792 use arbitrary::{Arbitrary, Unstructured};
25793 let mut buf = [0u8; 1024];
25794 rng.fill_bytes(&mut buf);
25795 let mut unstructured = Unstructured::new(&buf);
25796 Self::arbitrary(&mut unstructured).unwrap_or_default()
25797 }
25798}
25799impl Default for RC_CHANNELS_RAW_DATA {
25800 fn default() -> Self {
25801 Self::DEFAULT.clone()
25802 }
25803}
25804impl MessageData for RC_CHANNELS_RAW_DATA {
25805 type Message = MavMessage;
25806 const ID: u32 = 35u32;
25807 const NAME: &'static str = "RC_CHANNELS_RAW";
25808 const EXTRA_CRC: u8 = 244u8;
25809 const ENCODED_LEN: usize = 22usize;
25810 fn deser(
25811 _version: MavlinkVersion,
25812 __input: &[u8],
25813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25814 let avail_len = __input.len();
25815 let mut payload_buf = [0; Self::ENCODED_LEN];
25816 let mut buf = if avail_len < Self::ENCODED_LEN {
25817 payload_buf[0..avail_len].copy_from_slice(__input);
25818 Bytes::new(&payload_buf)
25819 } else {
25820 Bytes::new(__input)
25821 };
25822 let mut __struct = Self::default();
25823 __struct.time_boot_ms = buf.get_u32_le()?;
25824 __struct.chan1_raw = buf.get_u16_le()?;
25825 __struct.chan2_raw = buf.get_u16_le()?;
25826 __struct.chan3_raw = buf.get_u16_le()?;
25827 __struct.chan4_raw = buf.get_u16_le()?;
25828 __struct.chan5_raw = buf.get_u16_le()?;
25829 __struct.chan6_raw = buf.get_u16_le()?;
25830 __struct.chan7_raw = buf.get_u16_le()?;
25831 __struct.chan8_raw = buf.get_u16_le()?;
25832 __struct.port = buf.get_u8()?;
25833 __struct.rssi = buf.get_u8()?;
25834 Ok(__struct)
25835 }
25836 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25837 let mut __tmp = BytesMut::new(bytes);
25838 #[allow(clippy::absurd_extreme_comparisons)]
25839 #[allow(unused_comparisons)]
25840 if __tmp.remaining() < Self::ENCODED_LEN {
25841 panic!(
25842 "buffer is too small (need {} bytes, but got {})",
25843 Self::ENCODED_LEN,
25844 __tmp.remaining(),
25845 )
25846 }
25847 __tmp.put_u32_le(self.time_boot_ms);
25848 __tmp.put_u16_le(self.chan1_raw);
25849 __tmp.put_u16_le(self.chan2_raw);
25850 __tmp.put_u16_le(self.chan3_raw);
25851 __tmp.put_u16_le(self.chan4_raw);
25852 __tmp.put_u16_le(self.chan5_raw);
25853 __tmp.put_u16_le(self.chan6_raw);
25854 __tmp.put_u16_le(self.chan7_raw);
25855 __tmp.put_u16_le(self.chan8_raw);
25856 __tmp.put_u8(self.port);
25857 __tmp.put_u8(self.rssi);
25858 if matches!(version, MavlinkVersion::V2) {
25859 let len = __tmp.len();
25860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25861 } else {
25862 __tmp.len()
25863 }
25864 }
25865}
25866#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25867#[doc = ""]
25868#[doc = "ID: 34"]
25869#[derive(Debug, Clone, PartialEq)]
25870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25872#[cfg_attr(feature = "ts", derive(TS))]
25873#[cfg_attr(feature = "ts", ts(export))]
25874pub struct RC_CHANNELS_SCALED_DATA {
25875 #[doc = "Timestamp (time since system boot)."]
25876 pub time_boot_ms: u32,
25877 #[doc = "RC channel 1 value scaled."]
25878 pub chan1_scaled: i16,
25879 #[doc = "RC channel 2 value scaled."]
25880 pub chan2_scaled: i16,
25881 #[doc = "RC channel 3 value scaled."]
25882 pub chan3_scaled: i16,
25883 #[doc = "RC channel 4 value scaled."]
25884 pub chan4_scaled: i16,
25885 #[doc = "RC channel 5 value scaled."]
25886 pub chan5_scaled: i16,
25887 #[doc = "RC channel 6 value scaled."]
25888 pub chan6_scaled: i16,
25889 #[doc = "RC channel 7 value scaled."]
25890 pub chan7_scaled: i16,
25891 #[doc = "RC channel 8 value scaled."]
25892 pub chan8_scaled: i16,
25893 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25894 pub port: u8,
25895 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25896 pub rssi: u8,
25897}
25898impl RC_CHANNELS_SCALED_DATA {
25899 pub const ENCODED_LEN: usize = 22usize;
25900 pub const DEFAULT: Self = Self {
25901 time_boot_ms: 0_u32,
25902 chan1_scaled: 0_i16,
25903 chan2_scaled: 0_i16,
25904 chan3_scaled: 0_i16,
25905 chan4_scaled: 0_i16,
25906 chan5_scaled: 0_i16,
25907 chan6_scaled: 0_i16,
25908 chan7_scaled: 0_i16,
25909 chan8_scaled: 0_i16,
25910 port: 0_u8,
25911 rssi: 0_u8,
25912 };
25913 #[cfg(feature = "arbitrary")]
25914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25915 use arbitrary::{Arbitrary, Unstructured};
25916 let mut buf = [0u8; 1024];
25917 rng.fill_bytes(&mut buf);
25918 let mut unstructured = Unstructured::new(&buf);
25919 Self::arbitrary(&mut unstructured).unwrap_or_default()
25920 }
25921}
25922impl Default for RC_CHANNELS_SCALED_DATA {
25923 fn default() -> Self {
25924 Self::DEFAULT.clone()
25925 }
25926}
25927impl MessageData for RC_CHANNELS_SCALED_DATA {
25928 type Message = MavMessage;
25929 const ID: u32 = 34u32;
25930 const NAME: &'static str = "RC_CHANNELS_SCALED";
25931 const EXTRA_CRC: u8 = 237u8;
25932 const ENCODED_LEN: usize = 22usize;
25933 fn deser(
25934 _version: MavlinkVersion,
25935 __input: &[u8],
25936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25937 let avail_len = __input.len();
25938 let mut payload_buf = [0; Self::ENCODED_LEN];
25939 let mut buf = if avail_len < Self::ENCODED_LEN {
25940 payload_buf[0..avail_len].copy_from_slice(__input);
25941 Bytes::new(&payload_buf)
25942 } else {
25943 Bytes::new(__input)
25944 };
25945 let mut __struct = Self::default();
25946 __struct.time_boot_ms = buf.get_u32_le()?;
25947 __struct.chan1_scaled = buf.get_i16_le()?;
25948 __struct.chan2_scaled = buf.get_i16_le()?;
25949 __struct.chan3_scaled = buf.get_i16_le()?;
25950 __struct.chan4_scaled = buf.get_i16_le()?;
25951 __struct.chan5_scaled = buf.get_i16_le()?;
25952 __struct.chan6_scaled = buf.get_i16_le()?;
25953 __struct.chan7_scaled = buf.get_i16_le()?;
25954 __struct.chan8_scaled = buf.get_i16_le()?;
25955 __struct.port = buf.get_u8()?;
25956 __struct.rssi = buf.get_u8()?;
25957 Ok(__struct)
25958 }
25959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25960 let mut __tmp = BytesMut::new(bytes);
25961 #[allow(clippy::absurd_extreme_comparisons)]
25962 #[allow(unused_comparisons)]
25963 if __tmp.remaining() < Self::ENCODED_LEN {
25964 panic!(
25965 "buffer is too small (need {} bytes, but got {})",
25966 Self::ENCODED_LEN,
25967 __tmp.remaining(),
25968 )
25969 }
25970 __tmp.put_u32_le(self.time_boot_ms);
25971 __tmp.put_i16_le(self.chan1_scaled);
25972 __tmp.put_i16_le(self.chan2_scaled);
25973 __tmp.put_i16_le(self.chan3_scaled);
25974 __tmp.put_i16_le(self.chan4_scaled);
25975 __tmp.put_i16_le(self.chan5_scaled);
25976 __tmp.put_i16_le(self.chan6_scaled);
25977 __tmp.put_i16_le(self.chan7_scaled);
25978 __tmp.put_i16_le(self.chan8_scaled);
25979 __tmp.put_u8(self.port);
25980 __tmp.put_u8(self.rssi);
25981 if matches!(version, MavlinkVersion::V2) {
25982 let len = __tmp.len();
25983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25984 } else {
25985 __tmp.len()
25986 }
25987 }
25988}
25989#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25990#[doc = "Request a data stream."]
25991#[doc = ""]
25992#[doc = "ID: 66"]
25993#[derive(Debug, Clone, PartialEq)]
25994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25996#[cfg_attr(feature = "ts", derive(TS))]
25997#[cfg_attr(feature = "ts", ts(export))]
25998pub struct REQUEST_DATA_STREAM_DATA {
25999 #[doc = "The requested message rate"]
26000 pub req_message_rate: u16,
26001 #[doc = "The target requested to send the message stream."]
26002 pub target_system: u8,
26003 #[doc = "The target requested to send the message stream."]
26004 pub target_component: u8,
26005 #[doc = "The ID of the requested data stream"]
26006 pub req_stream_id: u8,
26007 #[doc = "1 to start sending, 0 to stop sending."]
26008 pub start_stop: u8,
26009}
26010impl REQUEST_DATA_STREAM_DATA {
26011 pub const ENCODED_LEN: usize = 6usize;
26012 pub const DEFAULT: Self = Self {
26013 req_message_rate: 0_u16,
26014 target_system: 0_u8,
26015 target_component: 0_u8,
26016 req_stream_id: 0_u8,
26017 start_stop: 0_u8,
26018 };
26019 #[cfg(feature = "arbitrary")]
26020 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26021 use arbitrary::{Arbitrary, Unstructured};
26022 let mut buf = [0u8; 1024];
26023 rng.fill_bytes(&mut buf);
26024 let mut unstructured = Unstructured::new(&buf);
26025 Self::arbitrary(&mut unstructured).unwrap_or_default()
26026 }
26027}
26028impl Default for REQUEST_DATA_STREAM_DATA {
26029 fn default() -> Self {
26030 Self::DEFAULT.clone()
26031 }
26032}
26033impl MessageData for REQUEST_DATA_STREAM_DATA {
26034 type Message = MavMessage;
26035 const ID: u32 = 66u32;
26036 const NAME: &'static str = "REQUEST_DATA_STREAM";
26037 const EXTRA_CRC: u8 = 148u8;
26038 const ENCODED_LEN: usize = 6usize;
26039 fn deser(
26040 _version: MavlinkVersion,
26041 __input: &[u8],
26042 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26043 let avail_len = __input.len();
26044 let mut payload_buf = [0; Self::ENCODED_LEN];
26045 let mut buf = if avail_len < Self::ENCODED_LEN {
26046 payload_buf[0..avail_len].copy_from_slice(__input);
26047 Bytes::new(&payload_buf)
26048 } else {
26049 Bytes::new(__input)
26050 };
26051 let mut __struct = Self::default();
26052 __struct.req_message_rate = buf.get_u16_le()?;
26053 __struct.target_system = buf.get_u8()?;
26054 __struct.target_component = buf.get_u8()?;
26055 __struct.req_stream_id = buf.get_u8()?;
26056 __struct.start_stop = buf.get_u8()?;
26057 Ok(__struct)
26058 }
26059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26060 let mut __tmp = BytesMut::new(bytes);
26061 #[allow(clippy::absurd_extreme_comparisons)]
26062 #[allow(unused_comparisons)]
26063 if __tmp.remaining() < Self::ENCODED_LEN {
26064 panic!(
26065 "buffer is too small (need {} bytes, but got {})",
26066 Self::ENCODED_LEN,
26067 __tmp.remaining(),
26068 )
26069 }
26070 __tmp.put_u16_le(self.req_message_rate);
26071 __tmp.put_u8(self.target_system);
26072 __tmp.put_u8(self.target_component);
26073 __tmp.put_u8(self.req_stream_id);
26074 __tmp.put_u8(self.start_stop);
26075 if matches!(version, MavlinkVersion::V2) {
26076 let len = __tmp.len();
26077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26078 } else {
26079 __tmp.len()
26080 }
26081 }
26082}
26083#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26084#[doc = ""]
26085#[doc = "ID: 412"]
26086#[derive(Debug, Clone, PartialEq)]
26087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26089#[cfg_attr(feature = "ts", derive(TS))]
26090#[cfg_attr(feature = "ts", ts(export))]
26091pub struct REQUEST_EVENT_DATA {
26092 #[doc = "First sequence number of the requested event."]
26093 pub first_sequence: u16,
26094 #[doc = "Last sequence number of the requested event."]
26095 pub last_sequence: u16,
26096 #[doc = "System ID"]
26097 pub target_system: u8,
26098 #[doc = "Component ID"]
26099 pub target_component: u8,
26100}
26101impl REQUEST_EVENT_DATA {
26102 pub const ENCODED_LEN: usize = 6usize;
26103 pub const DEFAULT: Self = Self {
26104 first_sequence: 0_u16,
26105 last_sequence: 0_u16,
26106 target_system: 0_u8,
26107 target_component: 0_u8,
26108 };
26109 #[cfg(feature = "arbitrary")]
26110 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26111 use arbitrary::{Arbitrary, Unstructured};
26112 let mut buf = [0u8; 1024];
26113 rng.fill_bytes(&mut buf);
26114 let mut unstructured = Unstructured::new(&buf);
26115 Self::arbitrary(&mut unstructured).unwrap_or_default()
26116 }
26117}
26118impl Default for REQUEST_EVENT_DATA {
26119 fn default() -> Self {
26120 Self::DEFAULT.clone()
26121 }
26122}
26123impl MessageData for REQUEST_EVENT_DATA {
26124 type Message = MavMessage;
26125 const ID: u32 = 412u32;
26126 const NAME: &'static str = "REQUEST_EVENT";
26127 const EXTRA_CRC: u8 = 33u8;
26128 const ENCODED_LEN: usize = 6usize;
26129 fn deser(
26130 _version: MavlinkVersion,
26131 __input: &[u8],
26132 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26133 let avail_len = __input.len();
26134 let mut payload_buf = [0; Self::ENCODED_LEN];
26135 let mut buf = if avail_len < Self::ENCODED_LEN {
26136 payload_buf[0..avail_len].copy_from_slice(__input);
26137 Bytes::new(&payload_buf)
26138 } else {
26139 Bytes::new(__input)
26140 };
26141 let mut __struct = Self::default();
26142 __struct.first_sequence = buf.get_u16_le()?;
26143 __struct.last_sequence = buf.get_u16_le()?;
26144 __struct.target_system = buf.get_u8()?;
26145 __struct.target_component = buf.get_u8()?;
26146 Ok(__struct)
26147 }
26148 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26149 let mut __tmp = BytesMut::new(bytes);
26150 #[allow(clippy::absurd_extreme_comparisons)]
26151 #[allow(unused_comparisons)]
26152 if __tmp.remaining() < Self::ENCODED_LEN {
26153 panic!(
26154 "buffer is too small (need {} bytes, but got {})",
26155 Self::ENCODED_LEN,
26156 __tmp.remaining(),
26157 )
26158 }
26159 __tmp.put_u16_le(self.first_sequence);
26160 __tmp.put_u16_le(self.last_sequence);
26161 __tmp.put_u8(self.target_system);
26162 __tmp.put_u8(self.target_component);
26163 if matches!(version, MavlinkVersion::V2) {
26164 let len = __tmp.len();
26165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26166 } else {
26167 __tmp.len()
26168 }
26169 }
26170}
26171#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26172#[doc = ""]
26173#[doc = "ID: 142"]
26174#[derive(Debug, Clone, PartialEq)]
26175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26177#[cfg_attr(feature = "ts", derive(TS))]
26178#[cfg_attr(feature = "ts", ts(export))]
26179pub struct RESOURCE_REQUEST_DATA {
26180 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26181 pub request_id: u8,
26182 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26183 pub uri_type: u8,
26184 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26186 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26187 pub uri: [u8; 120],
26188 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26189 pub transfer_type: u8,
26190 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26192 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26193 pub storage: [u8; 120],
26194}
26195impl RESOURCE_REQUEST_DATA {
26196 pub const ENCODED_LEN: usize = 243usize;
26197 pub const DEFAULT: Self = Self {
26198 request_id: 0_u8,
26199 uri_type: 0_u8,
26200 uri: [0_u8; 120usize],
26201 transfer_type: 0_u8,
26202 storage: [0_u8; 120usize],
26203 };
26204 #[cfg(feature = "arbitrary")]
26205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26206 use arbitrary::{Arbitrary, Unstructured};
26207 let mut buf = [0u8; 1024];
26208 rng.fill_bytes(&mut buf);
26209 let mut unstructured = Unstructured::new(&buf);
26210 Self::arbitrary(&mut unstructured).unwrap_or_default()
26211 }
26212}
26213impl Default for RESOURCE_REQUEST_DATA {
26214 fn default() -> Self {
26215 Self::DEFAULT.clone()
26216 }
26217}
26218impl MessageData for RESOURCE_REQUEST_DATA {
26219 type Message = MavMessage;
26220 const ID: u32 = 142u32;
26221 const NAME: &'static str = "RESOURCE_REQUEST";
26222 const EXTRA_CRC: u8 = 72u8;
26223 const ENCODED_LEN: usize = 243usize;
26224 fn deser(
26225 _version: MavlinkVersion,
26226 __input: &[u8],
26227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26228 let avail_len = __input.len();
26229 let mut payload_buf = [0; Self::ENCODED_LEN];
26230 let mut buf = if avail_len < Self::ENCODED_LEN {
26231 payload_buf[0..avail_len].copy_from_slice(__input);
26232 Bytes::new(&payload_buf)
26233 } else {
26234 Bytes::new(__input)
26235 };
26236 let mut __struct = Self::default();
26237 __struct.request_id = buf.get_u8()?;
26238 __struct.uri_type = buf.get_u8()?;
26239 for v in &mut __struct.uri {
26240 let val = buf.get_u8()?;
26241 *v = val;
26242 }
26243 __struct.transfer_type = buf.get_u8()?;
26244 for v in &mut __struct.storage {
26245 let val = buf.get_u8()?;
26246 *v = val;
26247 }
26248 Ok(__struct)
26249 }
26250 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26251 let mut __tmp = BytesMut::new(bytes);
26252 #[allow(clippy::absurd_extreme_comparisons)]
26253 #[allow(unused_comparisons)]
26254 if __tmp.remaining() < Self::ENCODED_LEN {
26255 panic!(
26256 "buffer is too small (need {} bytes, but got {})",
26257 Self::ENCODED_LEN,
26258 __tmp.remaining(),
26259 )
26260 }
26261 __tmp.put_u8(self.request_id);
26262 __tmp.put_u8(self.uri_type);
26263 for val in &self.uri {
26264 __tmp.put_u8(*val);
26265 }
26266 __tmp.put_u8(self.transfer_type);
26267 for val in &self.storage {
26268 __tmp.put_u8(*val);
26269 }
26270 if matches!(version, MavlinkVersion::V2) {
26271 let len = __tmp.len();
26272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26273 } else {
26274 __tmp.len()
26275 }
26276 }
26277}
26278#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26279#[doc = ""]
26280#[doc = "ID: 413"]
26281#[derive(Debug, Clone, PartialEq)]
26282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26284#[cfg_attr(feature = "ts", derive(TS))]
26285#[cfg_attr(feature = "ts", ts(export))]
26286pub struct RESPONSE_EVENT_ERROR_DATA {
26287 #[doc = "Sequence number."]
26288 pub sequence: u16,
26289 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26290 pub sequence_oldest_available: u16,
26291 #[doc = "System ID"]
26292 pub target_system: u8,
26293 #[doc = "Component ID"]
26294 pub target_component: u8,
26295 #[doc = "Error reason."]
26296 pub reason: MavEventErrorReason,
26297}
26298impl RESPONSE_EVENT_ERROR_DATA {
26299 pub const ENCODED_LEN: usize = 7usize;
26300 pub const DEFAULT: Self = Self {
26301 sequence: 0_u16,
26302 sequence_oldest_available: 0_u16,
26303 target_system: 0_u8,
26304 target_component: 0_u8,
26305 reason: MavEventErrorReason::DEFAULT,
26306 };
26307 #[cfg(feature = "arbitrary")]
26308 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26309 use arbitrary::{Arbitrary, Unstructured};
26310 let mut buf = [0u8; 1024];
26311 rng.fill_bytes(&mut buf);
26312 let mut unstructured = Unstructured::new(&buf);
26313 Self::arbitrary(&mut unstructured).unwrap_or_default()
26314 }
26315}
26316impl Default for RESPONSE_EVENT_ERROR_DATA {
26317 fn default() -> Self {
26318 Self::DEFAULT.clone()
26319 }
26320}
26321impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26322 type Message = MavMessage;
26323 const ID: u32 = 413u32;
26324 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26325 const EXTRA_CRC: u8 = 77u8;
26326 const ENCODED_LEN: usize = 7usize;
26327 fn deser(
26328 _version: MavlinkVersion,
26329 __input: &[u8],
26330 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26331 let avail_len = __input.len();
26332 let mut payload_buf = [0; Self::ENCODED_LEN];
26333 let mut buf = if avail_len < Self::ENCODED_LEN {
26334 payload_buf[0..avail_len].copy_from_slice(__input);
26335 Bytes::new(&payload_buf)
26336 } else {
26337 Bytes::new(__input)
26338 };
26339 let mut __struct = Self::default();
26340 __struct.sequence = buf.get_u16_le()?;
26341 __struct.sequence_oldest_available = buf.get_u16_le()?;
26342 __struct.target_system = buf.get_u8()?;
26343 __struct.target_component = buf.get_u8()?;
26344 let tmp = buf.get_u8()?;
26345 __struct.reason =
26346 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26347 enum_type: "MavEventErrorReason",
26348 value: tmp as u64,
26349 })?;
26350 Ok(__struct)
26351 }
26352 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26353 let mut __tmp = BytesMut::new(bytes);
26354 #[allow(clippy::absurd_extreme_comparisons)]
26355 #[allow(unused_comparisons)]
26356 if __tmp.remaining() < Self::ENCODED_LEN {
26357 panic!(
26358 "buffer is too small (need {} bytes, but got {})",
26359 Self::ENCODED_LEN,
26360 __tmp.remaining(),
26361 )
26362 }
26363 __tmp.put_u16_le(self.sequence);
26364 __tmp.put_u16_le(self.sequence_oldest_available);
26365 __tmp.put_u8(self.target_system);
26366 __tmp.put_u8(self.target_component);
26367 __tmp.put_u8(self.reason as u8);
26368 if matches!(version, MavlinkVersion::V2) {
26369 let len = __tmp.len();
26370 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26371 } else {
26372 __tmp.len()
26373 }
26374 }
26375}
26376#[doc = "Read out the safety zone the MAV currently assumes."]
26377#[doc = ""]
26378#[doc = "ID: 55"]
26379#[derive(Debug, Clone, PartialEq)]
26380#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26382#[cfg_attr(feature = "ts", derive(TS))]
26383#[cfg_attr(feature = "ts", ts(export))]
26384pub struct SAFETY_ALLOWED_AREA_DATA {
26385 #[doc = "x position 1 / Latitude 1"]
26386 pub p1x: f32,
26387 #[doc = "y position 1 / Longitude 1"]
26388 pub p1y: f32,
26389 #[doc = "z position 1 / Altitude 1"]
26390 pub p1z: f32,
26391 #[doc = "x position 2 / Latitude 2"]
26392 pub p2x: f32,
26393 #[doc = "y position 2 / Longitude 2"]
26394 pub p2y: f32,
26395 #[doc = "z position 2 / Altitude 2"]
26396 pub p2z: f32,
26397 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26398 pub frame: MavFrame,
26399}
26400impl SAFETY_ALLOWED_AREA_DATA {
26401 pub const ENCODED_LEN: usize = 25usize;
26402 pub const DEFAULT: Self = Self {
26403 p1x: 0.0_f32,
26404 p1y: 0.0_f32,
26405 p1z: 0.0_f32,
26406 p2x: 0.0_f32,
26407 p2y: 0.0_f32,
26408 p2z: 0.0_f32,
26409 frame: MavFrame::DEFAULT,
26410 };
26411 #[cfg(feature = "arbitrary")]
26412 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26413 use arbitrary::{Arbitrary, Unstructured};
26414 let mut buf = [0u8; 1024];
26415 rng.fill_bytes(&mut buf);
26416 let mut unstructured = Unstructured::new(&buf);
26417 Self::arbitrary(&mut unstructured).unwrap_or_default()
26418 }
26419}
26420impl Default for SAFETY_ALLOWED_AREA_DATA {
26421 fn default() -> Self {
26422 Self::DEFAULT.clone()
26423 }
26424}
26425impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26426 type Message = MavMessage;
26427 const ID: u32 = 55u32;
26428 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26429 const EXTRA_CRC: u8 = 3u8;
26430 const ENCODED_LEN: usize = 25usize;
26431 fn deser(
26432 _version: MavlinkVersion,
26433 __input: &[u8],
26434 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26435 let avail_len = __input.len();
26436 let mut payload_buf = [0; Self::ENCODED_LEN];
26437 let mut buf = if avail_len < Self::ENCODED_LEN {
26438 payload_buf[0..avail_len].copy_from_slice(__input);
26439 Bytes::new(&payload_buf)
26440 } else {
26441 Bytes::new(__input)
26442 };
26443 let mut __struct = Self::default();
26444 __struct.p1x = buf.get_f32_le()?;
26445 __struct.p1y = buf.get_f32_le()?;
26446 __struct.p1z = buf.get_f32_le()?;
26447 __struct.p2x = buf.get_f32_le()?;
26448 __struct.p2y = buf.get_f32_le()?;
26449 __struct.p2z = buf.get_f32_le()?;
26450 let tmp = buf.get_u8()?;
26451 __struct.frame =
26452 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26453 enum_type: "MavFrame",
26454 value: tmp as u64,
26455 })?;
26456 Ok(__struct)
26457 }
26458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26459 let mut __tmp = BytesMut::new(bytes);
26460 #[allow(clippy::absurd_extreme_comparisons)]
26461 #[allow(unused_comparisons)]
26462 if __tmp.remaining() < Self::ENCODED_LEN {
26463 panic!(
26464 "buffer is too small (need {} bytes, but got {})",
26465 Self::ENCODED_LEN,
26466 __tmp.remaining(),
26467 )
26468 }
26469 __tmp.put_f32_le(self.p1x);
26470 __tmp.put_f32_le(self.p1y);
26471 __tmp.put_f32_le(self.p1z);
26472 __tmp.put_f32_le(self.p2x);
26473 __tmp.put_f32_le(self.p2y);
26474 __tmp.put_f32_le(self.p2z);
26475 __tmp.put_u8(self.frame as u8);
26476 if matches!(version, MavlinkVersion::V2) {
26477 let len = __tmp.len();
26478 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26479 } else {
26480 __tmp.len()
26481 }
26482 }
26483}
26484#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26485#[doc = ""]
26486#[doc = "ID: 54"]
26487#[derive(Debug, Clone, PartialEq)]
26488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26490#[cfg_attr(feature = "ts", derive(TS))]
26491#[cfg_attr(feature = "ts", ts(export))]
26492pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26493 #[doc = "x position 1 / Latitude 1"]
26494 pub p1x: f32,
26495 #[doc = "y position 1 / Longitude 1"]
26496 pub p1y: f32,
26497 #[doc = "z position 1 / Altitude 1"]
26498 pub p1z: f32,
26499 #[doc = "x position 2 / Latitude 2"]
26500 pub p2x: f32,
26501 #[doc = "y position 2 / Longitude 2"]
26502 pub p2y: f32,
26503 #[doc = "z position 2 / Altitude 2"]
26504 pub p2z: f32,
26505 #[doc = "System ID"]
26506 pub target_system: u8,
26507 #[doc = "Component ID"]
26508 pub target_component: u8,
26509 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26510 pub frame: MavFrame,
26511}
26512impl SAFETY_SET_ALLOWED_AREA_DATA {
26513 pub const ENCODED_LEN: usize = 27usize;
26514 pub const DEFAULT: Self = Self {
26515 p1x: 0.0_f32,
26516 p1y: 0.0_f32,
26517 p1z: 0.0_f32,
26518 p2x: 0.0_f32,
26519 p2y: 0.0_f32,
26520 p2z: 0.0_f32,
26521 target_system: 0_u8,
26522 target_component: 0_u8,
26523 frame: MavFrame::DEFAULT,
26524 };
26525 #[cfg(feature = "arbitrary")]
26526 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26527 use arbitrary::{Arbitrary, Unstructured};
26528 let mut buf = [0u8; 1024];
26529 rng.fill_bytes(&mut buf);
26530 let mut unstructured = Unstructured::new(&buf);
26531 Self::arbitrary(&mut unstructured).unwrap_or_default()
26532 }
26533}
26534impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26535 fn default() -> Self {
26536 Self::DEFAULT.clone()
26537 }
26538}
26539impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26540 type Message = MavMessage;
26541 const ID: u32 = 54u32;
26542 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26543 const EXTRA_CRC: u8 = 15u8;
26544 const ENCODED_LEN: usize = 27usize;
26545 fn deser(
26546 _version: MavlinkVersion,
26547 __input: &[u8],
26548 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26549 let avail_len = __input.len();
26550 let mut payload_buf = [0; Self::ENCODED_LEN];
26551 let mut buf = if avail_len < Self::ENCODED_LEN {
26552 payload_buf[0..avail_len].copy_from_slice(__input);
26553 Bytes::new(&payload_buf)
26554 } else {
26555 Bytes::new(__input)
26556 };
26557 let mut __struct = Self::default();
26558 __struct.p1x = buf.get_f32_le()?;
26559 __struct.p1y = buf.get_f32_le()?;
26560 __struct.p1z = buf.get_f32_le()?;
26561 __struct.p2x = buf.get_f32_le()?;
26562 __struct.p2y = buf.get_f32_le()?;
26563 __struct.p2z = buf.get_f32_le()?;
26564 __struct.target_system = buf.get_u8()?;
26565 __struct.target_component = buf.get_u8()?;
26566 let tmp = buf.get_u8()?;
26567 __struct.frame =
26568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26569 enum_type: "MavFrame",
26570 value: tmp as u64,
26571 })?;
26572 Ok(__struct)
26573 }
26574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26575 let mut __tmp = BytesMut::new(bytes);
26576 #[allow(clippy::absurd_extreme_comparisons)]
26577 #[allow(unused_comparisons)]
26578 if __tmp.remaining() < Self::ENCODED_LEN {
26579 panic!(
26580 "buffer is too small (need {} bytes, but got {})",
26581 Self::ENCODED_LEN,
26582 __tmp.remaining(),
26583 )
26584 }
26585 __tmp.put_f32_le(self.p1x);
26586 __tmp.put_f32_le(self.p1y);
26587 __tmp.put_f32_le(self.p1z);
26588 __tmp.put_f32_le(self.p2x);
26589 __tmp.put_f32_le(self.p2y);
26590 __tmp.put_f32_le(self.p2z);
26591 __tmp.put_u8(self.target_system);
26592 __tmp.put_u8(self.target_component);
26593 __tmp.put_u8(self.frame as u8);
26594 if matches!(version, MavlinkVersion::V2) {
26595 let len = __tmp.len();
26596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26597 } else {
26598 __tmp.len()
26599 }
26600 }
26601}
26602#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26603#[doc = ""]
26604#[doc = "ID: 26"]
26605#[derive(Debug, Clone, PartialEq)]
26606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26608#[cfg_attr(feature = "ts", derive(TS))]
26609#[cfg_attr(feature = "ts", ts(export))]
26610pub struct SCALED_IMU_DATA {
26611 #[doc = "Timestamp (time since system boot)."]
26612 pub time_boot_ms: u32,
26613 #[doc = "X acceleration"]
26614 pub xacc: i16,
26615 #[doc = "Y acceleration"]
26616 pub yacc: i16,
26617 #[doc = "Z acceleration"]
26618 pub zacc: i16,
26619 #[doc = "Angular speed around X axis"]
26620 pub xgyro: i16,
26621 #[doc = "Angular speed around Y axis"]
26622 pub ygyro: i16,
26623 #[doc = "Angular speed around Z axis"]
26624 pub zgyro: i16,
26625 #[doc = "X Magnetic field"]
26626 pub xmag: i16,
26627 #[doc = "Y Magnetic field"]
26628 pub ymag: i16,
26629 #[doc = "Z Magnetic field"]
26630 pub zmag: i16,
26631 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26632 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26633 pub temperature: i16,
26634}
26635impl SCALED_IMU_DATA {
26636 pub const ENCODED_LEN: usize = 24usize;
26637 pub const DEFAULT: Self = Self {
26638 time_boot_ms: 0_u32,
26639 xacc: 0_i16,
26640 yacc: 0_i16,
26641 zacc: 0_i16,
26642 xgyro: 0_i16,
26643 ygyro: 0_i16,
26644 zgyro: 0_i16,
26645 xmag: 0_i16,
26646 ymag: 0_i16,
26647 zmag: 0_i16,
26648 temperature: 0_i16,
26649 };
26650 #[cfg(feature = "arbitrary")]
26651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26652 use arbitrary::{Arbitrary, Unstructured};
26653 let mut buf = [0u8; 1024];
26654 rng.fill_bytes(&mut buf);
26655 let mut unstructured = Unstructured::new(&buf);
26656 Self::arbitrary(&mut unstructured).unwrap_or_default()
26657 }
26658}
26659impl Default for SCALED_IMU_DATA {
26660 fn default() -> Self {
26661 Self::DEFAULT.clone()
26662 }
26663}
26664impl MessageData for SCALED_IMU_DATA {
26665 type Message = MavMessage;
26666 const ID: u32 = 26u32;
26667 const NAME: &'static str = "SCALED_IMU";
26668 const EXTRA_CRC: u8 = 170u8;
26669 const ENCODED_LEN: usize = 24usize;
26670 fn deser(
26671 _version: MavlinkVersion,
26672 __input: &[u8],
26673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26674 let avail_len = __input.len();
26675 let mut payload_buf = [0; Self::ENCODED_LEN];
26676 let mut buf = if avail_len < Self::ENCODED_LEN {
26677 payload_buf[0..avail_len].copy_from_slice(__input);
26678 Bytes::new(&payload_buf)
26679 } else {
26680 Bytes::new(__input)
26681 };
26682 let mut __struct = Self::default();
26683 __struct.time_boot_ms = buf.get_u32_le()?;
26684 __struct.xacc = buf.get_i16_le()?;
26685 __struct.yacc = buf.get_i16_le()?;
26686 __struct.zacc = buf.get_i16_le()?;
26687 __struct.xgyro = buf.get_i16_le()?;
26688 __struct.ygyro = buf.get_i16_le()?;
26689 __struct.zgyro = buf.get_i16_le()?;
26690 __struct.xmag = buf.get_i16_le()?;
26691 __struct.ymag = buf.get_i16_le()?;
26692 __struct.zmag = buf.get_i16_le()?;
26693 __struct.temperature = buf.get_i16_le()?;
26694 Ok(__struct)
26695 }
26696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26697 let mut __tmp = BytesMut::new(bytes);
26698 #[allow(clippy::absurd_extreme_comparisons)]
26699 #[allow(unused_comparisons)]
26700 if __tmp.remaining() < Self::ENCODED_LEN {
26701 panic!(
26702 "buffer is too small (need {} bytes, but got {})",
26703 Self::ENCODED_LEN,
26704 __tmp.remaining(),
26705 )
26706 }
26707 __tmp.put_u32_le(self.time_boot_ms);
26708 __tmp.put_i16_le(self.xacc);
26709 __tmp.put_i16_le(self.yacc);
26710 __tmp.put_i16_le(self.zacc);
26711 __tmp.put_i16_le(self.xgyro);
26712 __tmp.put_i16_le(self.ygyro);
26713 __tmp.put_i16_le(self.zgyro);
26714 __tmp.put_i16_le(self.xmag);
26715 __tmp.put_i16_le(self.ymag);
26716 __tmp.put_i16_le(self.zmag);
26717 if matches!(version, MavlinkVersion::V2) {
26718 __tmp.put_i16_le(self.temperature);
26719 let len = __tmp.len();
26720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26721 } else {
26722 __tmp.len()
26723 }
26724 }
26725}
26726#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26727#[doc = ""]
26728#[doc = "ID: 116"]
26729#[derive(Debug, Clone, PartialEq)]
26730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26732#[cfg_attr(feature = "ts", derive(TS))]
26733#[cfg_attr(feature = "ts", ts(export))]
26734pub struct SCALED_IMU2_DATA {
26735 #[doc = "Timestamp (time since system boot)."]
26736 pub time_boot_ms: u32,
26737 #[doc = "X acceleration"]
26738 pub xacc: i16,
26739 #[doc = "Y acceleration"]
26740 pub yacc: i16,
26741 #[doc = "Z acceleration"]
26742 pub zacc: i16,
26743 #[doc = "Angular speed around X axis"]
26744 pub xgyro: i16,
26745 #[doc = "Angular speed around Y axis"]
26746 pub ygyro: i16,
26747 #[doc = "Angular speed around Z axis"]
26748 pub zgyro: i16,
26749 #[doc = "X Magnetic field"]
26750 pub xmag: i16,
26751 #[doc = "Y Magnetic field"]
26752 pub ymag: i16,
26753 #[doc = "Z Magnetic field"]
26754 pub zmag: i16,
26755 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26757 pub temperature: i16,
26758}
26759impl SCALED_IMU2_DATA {
26760 pub const ENCODED_LEN: usize = 24usize;
26761 pub const DEFAULT: Self = Self {
26762 time_boot_ms: 0_u32,
26763 xacc: 0_i16,
26764 yacc: 0_i16,
26765 zacc: 0_i16,
26766 xgyro: 0_i16,
26767 ygyro: 0_i16,
26768 zgyro: 0_i16,
26769 xmag: 0_i16,
26770 ymag: 0_i16,
26771 zmag: 0_i16,
26772 temperature: 0_i16,
26773 };
26774 #[cfg(feature = "arbitrary")]
26775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26776 use arbitrary::{Arbitrary, Unstructured};
26777 let mut buf = [0u8; 1024];
26778 rng.fill_bytes(&mut buf);
26779 let mut unstructured = Unstructured::new(&buf);
26780 Self::arbitrary(&mut unstructured).unwrap_or_default()
26781 }
26782}
26783impl Default for SCALED_IMU2_DATA {
26784 fn default() -> Self {
26785 Self::DEFAULT.clone()
26786 }
26787}
26788impl MessageData for SCALED_IMU2_DATA {
26789 type Message = MavMessage;
26790 const ID: u32 = 116u32;
26791 const NAME: &'static str = "SCALED_IMU2";
26792 const EXTRA_CRC: u8 = 76u8;
26793 const ENCODED_LEN: usize = 24usize;
26794 fn deser(
26795 _version: MavlinkVersion,
26796 __input: &[u8],
26797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26798 let avail_len = __input.len();
26799 let mut payload_buf = [0; Self::ENCODED_LEN];
26800 let mut buf = if avail_len < Self::ENCODED_LEN {
26801 payload_buf[0..avail_len].copy_from_slice(__input);
26802 Bytes::new(&payload_buf)
26803 } else {
26804 Bytes::new(__input)
26805 };
26806 let mut __struct = Self::default();
26807 __struct.time_boot_ms = buf.get_u32_le()?;
26808 __struct.xacc = buf.get_i16_le()?;
26809 __struct.yacc = buf.get_i16_le()?;
26810 __struct.zacc = buf.get_i16_le()?;
26811 __struct.xgyro = buf.get_i16_le()?;
26812 __struct.ygyro = buf.get_i16_le()?;
26813 __struct.zgyro = buf.get_i16_le()?;
26814 __struct.xmag = buf.get_i16_le()?;
26815 __struct.ymag = buf.get_i16_le()?;
26816 __struct.zmag = buf.get_i16_le()?;
26817 __struct.temperature = buf.get_i16_le()?;
26818 Ok(__struct)
26819 }
26820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26821 let mut __tmp = BytesMut::new(bytes);
26822 #[allow(clippy::absurd_extreme_comparisons)]
26823 #[allow(unused_comparisons)]
26824 if __tmp.remaining() < Self::ENCODED_LEN {
26825 panic!(
26826 "buffer is too small (need {} bytes, but got {})",
26827 Self::ENCODED_LEN,
26828 __tmp.remaining(),
26829 )
26830 }
26831 __tmp.put_u32_le(self.time_boot_ms);
26832 __tmp.put_i16_le(self.xacc);
26833 __tmp.put_i16_le(self.yacc);
26834 __tmp.put_i16_le(self.zacc);
26835 __tmp.put_i16_le(self.xgyro);
26836 __tmp.put_i16_le(self.ygyro);
26837 __tmp.put_i16_le(self.zgyro);
26838 __tmp.put_i16_le(self.xmag);
26839 __tmp.put_i16_le(self.ymag);
26840 __tmp.put_i16_le(self.zmag);
26841 if matches!(version, MavlinkVersion::V2) {
26842 __tmp.put_i16_le(self.temperature);
26843 let len = __tmp.len();
26844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26845 } else {
26846 __tmp.len()
26847 }
26848 }
26849}
26850#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26851#[doc = ""]
26852#[doc = "ID: 129"]
26853#[derive(Debug, Clone, PartialEq)]
26854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26856#[cfg_attr(feature = "ts", derive(TS))]
26857#[cfg_attr(feature = "ts", ts(export))]
26858pub struct SCALED_IMU3_DATA {
26859 #[doc = "Timestamp (time since system boot)."]
26860 pub time_boot_ms: u32,
26861 #[doc = "X acceleration"]
26862 pub xacc: i16,
26863 #[doc = "Y acceleration"]
26864 pub yacc: i16,
26865 #[doc = "Z acceleration"]
26866 pub zacc: i16,
26867 #[doc = "Angular speed around X axis"]
26868 pub xgyro: i16,
26869 #[doc = "Angular speed around Y axis"]
26870 pub ygyro: i16,
26871 #[doc = "Angular speed around Z axis"]
26872 pub zgyro: i16,
26873 #[doc = "X Magnetic field"]
26874 pub xmag: i16,
26875 #[doc = "Y Magnetic field"]
26876 pub ymag: i16,
26877 #[doc = "Z Magnetic field"]
26878 pub zmag: i16,
26879 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26881 pub temperature: i16,
26882}
26883impl SCALED_IMU3_DATA {
26884 pub const ENCODED_LEN: usize = 24usize;
26885 pub const DEFAULT: Self = Self {
26886 time_boot_ms: 0_u32,
26887 xacc: 0_i16,
26888 yacc: 0_i16,
26889 zacc: 0_i16,
26890 xgyro: 0_i16,
26891 ygyro: 0_i16,
26892 zgyro: 0_i16,
26893 xmag: 0_i16,
26894 ymag: 0_i16,
26895 zmag: 0_i16,
26896 temperature: 0_i16,
26897 };
26898 #[cfg(feature = "arbitrary")]
26899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26900 use arbitrary::{Arbitrary, Unstructured};
26901 let mut buf = [0u8; 1024];
26902 rng.fill_bytes(&mut buf);
26903 let mut unstructured = Unstructured::new(&buf);
26904 Self::arbitrary(&mut unstructured).unwrap_or_default()
26905 }
26906}
26907impl Default for SCALED_IMU3_DATA {
26908 fn default() -> Self {
26909 Self::DEFAULT.clone()
26910 }
26911}
26912impl MessageData for SCALED_IMU3_DATA {
26913 type Message = MavMessage;
26914 const ID: u32 = 129u32;
26915 const NAME: &'static str = "SCALED_IMU3";
26916 const EXTRA_CRC: u8 = 46u8;
26917 const ENCODED_LEN: usize = 24usize;
26918 fn deser(
26919 _version: MavlinkVersion,
26920 __input: &[u8],
26921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26922 let avail_len = __input.len();
26923 let mut payload_buf = [0; Self::ENCODED_LEN];
26924 let mut buf = if avail_len < Self::ENCODED_LEN {
26925 payload_buf[0..avail_len].copy_from_slice(__input);
26926 Bytes::new(&payload_buf)
26927 } else {
26928 Bytes::new(__input)
26929 };
26930 let mut __struct = Self::default();
26931 __struct.time_boot_ms = buf.get_u32_le()?;
26932 __struct.xacc = buf.get_i16_le()?;
26933 __struct.yacc = buf.get_i16_le()?;
26934 __struct.zacc = buf.get_i16_le()?;
26935 __struct.xgyro = buf.get_i16_le()?;
26936 __struct.ygyro = buf.get_i16_le()?;
26937 __struct.zgyro = buf.get_i16_le()?;
26938 __struct.xmag = buf.get_i16_le()?;
26939 __struct.ymag = buf.get_i16_le()?;
26940 __struct.zmag = buf.get_i16_le()?;
26941 __struct.temperature = buf.get_i16_le()?;
26942 Ok(__struct)
26943 }
26944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26945 let mut __tmp = BytesMut::new(bytes);
26946 #[allow(clippy::absurd_extreme_comparisons)]
26947 #[allow(unused_comparisons)]
26948 if __tmp.remaining() < Self::ENCODED_LEN {
26949 panic!(
26950 "buffer is too small (need {} bytes, but got {})",
26951 Self::ENCODED_LEN,
26952 __tmp.remaining(),
26953 )
26954 }
26955 __tmp.put_u32_le(self.time_boot_ms);
26956 __tmp.put_i16_le(self.xacc);
26957 __tmp.put_i16_le(self.yacc);
26958 __tmp.put_i16_le(self.zacc);
26959 __tmp.put_i16_le(self.xgyro);
26960 __tmp.put_i16_le(self.ygyro);
26961 __tmp.put_i16_le(self.zgyro);
26962 __tmp.put_i16_le(self.xmag);
26963 __tmp.put_i16_le(self.ymag);
26964 __tmp.put_i16_le(self.zmag);
26965 if matches!(version, MavlinkVersion::V2) {
26966 __tmp.put_i16_le(self.temperature);
26967 let len = __tmp.len();
26968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26969 } else {
26970 __tmp.len()
26971 }
26972 }
26973}
26974#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26975#[doc = ""]
26976#[doc = "ID: 29"]
26977#[derive(Debug, Clone, PartialEq)]
26978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26979#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26980#[cfg_attr(feature = "ts", derive(TS))]
26981#[cfg_attr(feature = "ts", ts(export))]
26982pub struct SCALED_PRESSURE_DATA {
26983 #[doc = "Timestamp (time since system boot)."]
26984 pub time_boot_ms: u32,
26985 #[doc = "Absolute pressure"]
26986 pub press_abs: f32,
26987 #[doc = "Differential pressure 1"]
26988 pub press_diff: f32,
26989 #[doc = "Absolute pressure temperature"]
26990 pub temperature: i16,
26991 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26992 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26993 pub temperature_press_diff: i16,
26994}
26995impl SCALED_PRESSURE_DATA {
26996 pub const ENCODED_LEN: usize = 16usize;
26997 pub const DEFAULT: Self = Self {
26998 time_boot_ms: 0_u32,
26999 press_abs: 0.0_f32,
27000 press_diff: 0.0_f32,
27001 temperature: 0_i16,
27002 temperature_press_diff: 0_i16,
27003 };
27004 #[cfg(feature = "arbitrary")]
27005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27006 use arbitrary::{Arbitrary, Unstructured};
27007 let mut buf = [0u8; 1024];
27008 rng.fill_bytes(&mut buf);
27009 let mut unstructured = Unstructured::new(&buf);
27010 Self::arbitrary(&mut unstructured).unwrap_or_default()
27011 }
27012}
27013impl Default for SCALED_PRESSURE_DATA {
27014 fn default() -> Self {
27015 Self::DEFAULT.clone()
27016 }
27017}
27018impl MessageData for SCALED_PRESSURE_DATA {
27019 type Message = MavMessage;
27020 const ID: u32 = 29u32;
27021 const NAME: &'static str = "SCALED_PRESSURE";
27022 const EXTRA_CRC: u8 = 115u8;
27023 const ENCODED_LEN: usize = 16usize;
27024 fn deser(
27025 _version: MavlinkVersion,
27026 __input: &[u8],
27027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27028 let avail_len = __input.len();
27029 let mut payload_buf = [0; Self::ENCODED_LEN];
27030 let mut buf = if avail_len < Self::ENCODED_LEN {
27031 payload_buf[0..avail_len].copy_from_slice(__input);
27032 Bytes::new(&payload_buf)
27033 } else {
27034 Bytes::new(__input)
27035 };
27036 let mut __struct = Self::default();
27037 __struct.time_boot_ms = buf.get_u32_le()?;
27038 __struct.press_abs = buf.get_f32_le()?;
27039 __struct.press_diff = buf.get_f32_le()?;
27040 __struct.temperature = buf.get_i16_le()?;
27041 __struct.temperature_press_diff = buf.get_i16_le()?;
27042 Ok(__struct)
27043 }
27044 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27045 let mut __tmp = BytesMut::new(bytes);
27046 #[allow(clippy::absurd_extreme_comparisons)]
27047 #[allow(unused_comparisons)]
27048 if __tmp.remaining() < Self::ENCODED_LEN {
27049 panic!(
27050 "buffer is too small (need {} bytes, but got {})",
27051 Self::ENCODED_LEN,
27052 __tmp.remaining(),
27053 )
27054 }
27055 __tmp.put_u32_le(self.time_boot_ms);
27056 __tmp.put_f32_le(self.press_abs);
27057 __tmp.put_f32_le(self.press_diff);
27058 __tmp.put_i16_le(self.temperature);
27059 if matches!(version, MavlinkVersion::V2) {
27060 __tmp.put_i16_le(self.temperature_press_diff);
27061 let len = __tmp.len();
27062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27063 } else {
27064 __tmp.len()
27065 }
27066 }
27067}
27068#[doc = "Barometer readings for 2nd barometer."]
27069#[doc = ""]
27070#[doc = "ID: 137"]
27071#[derive(Debug, Clone, PartialEq)]
27072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27074#[cfg_attr(feature = "ts", derive(TS))]
27075#[cfg_attr(feature = "ts", ts(export))]
27076pub struct SCALED_PRESSURE2_DATA {
27077 #[doc = "Timestamp (time since system boot)."]
27078 pub time_boot_ms: u32,
27079 #[doc = "Absolute pressure"]
27080 pub press_abs: f32,
27081 #[doc = "Differential pressure"]
27082 pub press_diff: f32,
27083 #[doc = "Absolute pressure temperature"]
27084 pub temperature: i16,
27085 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27086 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27087 pub temperature_press_diff: i16,
27088}
27089impl SCALED_PRESSURE2_DATA {
27090 pub const ENCODED_LEN: usize = 16usize;
27091 pub const DEFAULT: Self = Self {
27092 time_boot_ms: 0_u32,
27093 press_abs: 0.0_f32,
27094 press_diff: 0.0_f32,
27095 temperature: 0_i16,
27096 temperature_press_diff: 0_i16,
27097 };
27098 #[cfg(feature = "arbitrary")]
27099 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27100 use arbitrary::{Arbitrary, Unstructured};
27101 let mut buf = [0u8; 1024];
27102 rng.fill_bytes(&mut buf);
27103 let mut unstructured = Unstructured::new(&buf);
27104 Self::arbitrary(&mut unstructured).unwrap_or_default()
27105 }
27106}
27107impl Default for SCALED_PRESSURE2_DATA {
27108 fn default() -> Self {
27109 Self::DEFAULT.clone()
27110 }
27111}
27112impl MessageData for SCALED_PRESSURE2_DATA {
27113 type Message = MavMessage;
27114 const ID: u32 = 137u32;
27115 const NAME: &'static str = "SCALED_PRESSURE2";
27116 const EXTRA_CRC: u8 = 195u8;
27117 const ENCODED_LEN: usize = 16usize;
27118 fn deser(
27119 _version: MavlinkVersion,
27120 __input: &[u8],
27121 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27122 let avail_len = __input.len();
27123 let mut payload_buf = [0; Self::ENCODED_LEN];
27124 let mut buf = if avail_len < Self::ENCODED_LEN {
27125 payload_buf[0..avail_len].copy_from_slice(__input);
27126 Bytes::new(&payload_buf)
27127 } else {
27128 Bytes::new(__input)
27129 };
27130 let mut __struct = Self::default();
27131 __struct.time_boot_ms = buf.get_u32_le()?;
27132 __struct.press_abs = buf.get_f32_le()?;
27133 __struct.press_diff = buf.get_f32_le()?;
27134 __struct.temperature = buf.get_i16_le()?;
27135 __struct.temperature_press_diff = buf.get_i16_le()?;
27136 Ok(__struct)
27137 }
27138 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27139 let mut __tmp = BytesMut::new(bytes);
27140 #[allow(clippy::absurd_extreme_comparisons)]
27141 #[allow(unused_comparisons)]
27142 if __tmp.remaining() < Self::ENCODED_LEN {
27143 panic!(
27144 "buffer is too small (need {} bytes, but got {})",
27145 Self::ENCODED_LEN,
27146 __tmp.remaining(),
27147 )
27148 }
27149 __tmp.put_u32_le(self.time_boot_ms);
27150 __tmp.put_f32_le(self.press_abs);
27151 __tmp.put_f32_le(self.press_diff);
27152 __tmp.put_i16_le(self.temperature);
27153 if matches!(version, MavlinkVersion::V2) {
27154 __tmp.put_i16_le(self.temperature_press_diff);
27155 let len = __tmp.len();
27156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27157 } else {
27158 __tmp.len()
27159 }
27160 }
27161}
27162#[doc = "Barometer readings for 3rd barometer."]
27163#[doc = ""]
27164#[doc = "ID: 143"]
27165#[derive(Debug, Clone, PartialEq)]
27166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27168#[cfg_attr(feature = "ts", derive(TS))]
27169#[cfg_attr(feature = "ts", ts(export))]
27170pub struct SCALED_PRESSURE3_DATA {
27171 #[doc = "Timestamp (time since system boot)."]
27172 pub time_boot_ms: u32,
27173 #[doc = "Absolute pressure"]
27174 pub press_abs: f32,
27175 #[doc = "Differential pressure"]
27176 pub press_diff: f32,
27177 #[doc = "Absolute pressure temperature"]
27178 pub temperature: i16,
27179 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27180 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27181 pub temperature_press_diff: i16,
27182}
27183impl SCALED_PRESSURE3_DATA {
27184 pub const ENCODED_LEN: usize = 16usize;
27185 pub const DEFAULT: Self = Self {
27186 time_boot_ms: 0_u32,
27187 press_abs: 0.0_f32,
27188 press_diff: 0.0_f32,
27189 temperature: 0_i16,
27190 temperature_press_diff: 0_i16,
27191 };
27192 #[cfg(feature = "arbitrary")]
27193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27194 use arbitrary::{Arbitrary, Unstructured};
27195 let mut buf = [0u8; 1024];
27196 rng.fill_bytes(&mut buf);
27197 let mut unstructured = Unstructured::new(&buf);
27198 Self::arbitrary(&mut unstructured).unwrap_or_default()
27199 }
27200}
27201impl Default for SCALED_PRESSURE3_DATA {
27202 fn default() -> Self {
27203 Self::DEFAULT.clone()
27204 }
27205}
27206impl MessageData for SCALED_PRESSURE3_DATA {
27207 type Message = MavMessage;
27208 const ID: u32 = 143u32;
27209 const NAME: &'static str = "SCALED_PRESSURE3";
27210 const EXTRA_CRC: u8 = 131u8;
27211 const ENCODED_LEN: usize = 16usize;
27212 fn deser(
27213 _version: MavlinkVersion,
27214 __input: &[u8],
27215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27216 let avail_len = __input.len();
27217 let mut payload_buf = [0; Self::ENCODED_LEN];
27218 let mut buf = if avail_len < Self::ENCODED_LEN {
27219 payload_buf[0..avail_len].copy_from_slice(__input);
27220 Bytes::new(&payload_buf)
27221 } else {
27222 Bytes::new(__input)
27223 };
27224 let mut __struct = Self::default();
27225 __struct.time_boot_ms = buf.get_u32_le()?;
27226 __struct.press_abs = buf.get_f32_le()?;
27227 __struct.press_diff = buf.get_f32_le()?;
27228 __struct.temperature = buf.get_i16_le()?;
27229 __struct.temperature_press_diff = buf.get_i16_le()?;
27230 Ok(__struct)
27231 }
27232 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27233 let mut __tmp = BytesMut::new(bytes);
27234 #[allow(clippy::absurd_extreme_comparisons)]
27235 #[allow(unused_comparisons)]
27236 if __tmp.remaining() < Self::ENCODED_LEN {
27237 panic!(
27238 "buffer is too small (need {} bytes, but got {})",
27239 Self::ENCODED_LEN,
27240 __tmp.remaining(),
27241 )
27242 }
27243 __tmp.put_u32_le(self.time_boot_ms);
27244 __tmp.put_f32_le(self.press_abs);
27245 __tmp.put_f32_le(self.press_diff);
27246 __tmp.put_i16_le(self.temperature);
27247 if matches!(version, MavlinkVersion::V2) {
27248 __tmp.put_i16_le(self.temperature_press_diff);
27249 let len = __tmp.len();
27250 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27251 } else {
27252 __tmp.len()
27253 }
27254 }
27255}
27256#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27257#[doc = ""]
27258#[doc = "ID: 126"]
27259#[derive(Debug, Clone, PartialEq)]
27260#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27262#[cfg_attr(feature = "ts", derive(TS))]
27263#[cfg_attr(feature = "ts", ts(export))]
27264pub struct SERIAL_CONTROL_DATA {
27265 #[doc = "Baudrate of transfer. Zero means no change."]
27266 pub baudrate: u32,
27267 #[doc = "Timeout for reply data"]
27268 pub timeout: u16,
27269 #[doc = "Serial control device type."]
27270 pub device: SerialControlDev,
27271 #[doc = "Bitmap of serial control flags."]
27272 pub flags: SerialControlFlag,
27273 #[doc = "how many bytes in this transfer"]
27274 pub count: u8,
27275 #[doc = "serial data"]
27276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27277 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27278 pub data: [u8; 70],
27279 #[doc = "System ID"]
27280 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27281 pub target_system: u8,
27282 #[doc = "Component ID"]
27283 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27284 pub target_component: u8,
27285}
27286impl SERIAL_CONTROL_DATA {
27287 pub const ENCODED_LEN: usize = 81usize;
27288 pub const DEFAULT: Self = Self {
27289 baudrate: 0_u32,
27290 timeout: 0_u16,
27291 device: SerialControlDev::DEFAULT,
27292 flags: SerialControlFlag::DEFAULT,
27293 count: 0_u8,
27294 data: [0_u8; 70usize],
27295 target_system: 0_u8,
27296 target_component: 0_u8,
27297 };
27298 #[cfg(feature = "arbitrary")]
27299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27300 use arbitrary::{Arbitrary, Unstructured};
27301 let mut buf = [0u8; 1024];
27302 rng.fill_bytes(&mut buf);
27303 let mut unstructured = Unstructured::new(&buf);
27304 Self::arbitrary(&mut unstructured).unwrap_or_default()
27305 }
27306}
27307impl Default for SERIAL_CONTROL_DATA {
27308 fn default() -> Self {
27309 Self::DEFAULT.clone()
27310 }
27311}
27312impl MessageData for SERIAL_CONTROL_DATA {
27313 type Message = MavMessage;
27314 const ID: u32 = 126u32;
27315 const NAME: &'static str = "SERIAL_CONTROL";
27316 const EXTRA_CRC: u8 = 220u8;
27317 const ENCODED_LEN: usize = 81usize;
27318 fn deser(
27319 _version: MavlinkVersion,
27320 __input: &[u8],
27321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27322 let avail_len = __input.len();
27323 let mut payload_buf = [0; Self::ENCODED_LEN];
27324 let mut buf = if avail_len < Self::ENCODED_LEN {
27325 payload_buf[0..avail_len].copy_from_slice(__input);
27326 Bytes::new(&payload_buf)
27327 } else {
27328 Bytes::new(__input)
27329 };
27330 let mut __struct = Self::default();
27331 __struct.baudrate = buf.get_u32_le()?;
27332 __struct.timeout = buf.get_u16_le()?;
27333 let tmp = buf.get_u8()?;
27334 __struct.device =
27335 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27336 enum_type: "SerialControlDev",
27337 value: tmp as u64,
27338 })?;
27339 let tmp = buf.get_u8()?;
27340 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
27341 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27342 flag_type: "SerialControlFlag",
27343 value: tmp as u64,
27344 })?;
27345 __struct.count = buf.get_u8()?;
27346 for v in &mut __struct.data {
27347 let val = buf.get_u8()?;
27348 *v = val;
27349 }
27350 __struct.target_system = buf.get_u8()?;
27351 __struct.target_component = buf.get_u8()?;
27352 Ok(__struct)
27353 }
27354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27355 let mut __tmp = BytesMut::new(bytes);
27356 #[allow(clippy::absurd_extreme_comparisons)]
27357 #[allow(unused_comparisons)]
27358 if __tmp.remaining() < Self::ENCODED_LEN {
27359 panic!(
27360 "buffer is too small (need {} bytes, but got {})",
27361 Self::ENCODED_LEN,
27362 __tmp.remaining(),
27363 )
27364 }
27365 __tmp.put_u32_le(self.baudrate);
27366 __tmp.put_u16_le(self.timeout);
27367 __tmp.put_u8(self.device as u8);
27368 __tmp.put_u8(self.flags.bits() as u8);
27369 __tmp.put_u8(self.count);
27370 for val in &self.data {
27371 __tmp.put_u8(*val);
27372 }
27373 if matches!(version, MavlinkVersion::V2) {
27374 __tmp.put_u8(self.target_system);
27375 __tmp.put_u8(self.target_component);
27376 let len = __tmp.len();
27377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27378 } else {
27379 __tmp.len()
27380 }
27381 }
27382}
27383#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27384#[doc = ""]
27385#[doc = "ID: 36"]
27386#[derive(Debug, Clone, PartialEq)]
27387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27389#[cfg_attr(feature = "ts", derive(TS))]
27390#[cfg_attr(feature = "ts", ts(export))]
27391pub struct SERVO_OUTPUT_RAW_DATA {
27392 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27393 pub time_usec: u32,
27394 #[doc = "Servo output 1 value"]
27395 pub servo1_raw: u16,
27396 #[doc = "Servo output 2 value"]
27397 pub servo2_raw: u16,
27398 #[doc = "Servo output 3 value"]
27399 pub servo3_raw: u16,
27400 #[doc = "Servo output 4 value"]
27401 pub servo4_raw: u16,
27402 #[doc = "Servo output 5 value"]
27403 pub servo5_raw: u16,
27404 #[doc = "Servo output 6 value"]
27405 pub servo6_raw: u16,
27406 #[doc = "Servo output 7 value"]
27407 pub servo7_raw: u16,
27408 #[doc = "Servo output 8 value"]
27409 pub servo8_raw: u16,
27410 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27411 pub port: u8,
27412 #[doc = "Servo output 9 value"]
27413 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27414 pub servo9_raw: u16,
27415 #[doc = "Servo output 10 value"]
27416 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27417 pub servo10_raw: u16,
27418 #[doc = "Servo output 11 value"]
27419 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27420 pub servo11_raw: u16,
27421 #[doc = "Servo output 12 value"]
27422 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27423 pub servo12_raw: u16,
27424 #[doc = "Servo output 13 value"]
27425 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27426 pub servo13_raw: u16,
27427 #[doc = "Servo output 14 value"]
27428 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27429 pub servo14_raw: u16,
27430 #[doc = "Servo output 15 value"]
27431 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27432 pub servo15_raw: u16,
27433 #[doc = "Servo output 16 value"]
27434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27435 pub servo16_raw: u16,
27436}
27437impl SERVO_OUTPUT_RAW_DATA {
27438 pub const ENCODED_LEN: usize = 37usize;
27439 pub const DEFAULT: Self = Self {
27440 time_usec: 0_u32,
27441 servo1_raw: 0_u16,
27442 servo2_raw: 0_u16,
27443 servo3_raw: 0_u16,
27444 servo4_raw: 0_u16,
27445 servo5_raw: 0_u16,
27446 servo6_raw: 0_u16,
27447 servo7_raw: 0_u16,
27448 servo8_raw: 0_u16,
27449 port: 0_u8,
27450 servo9_raw: 0_u16,
27451 servo10_raw: 0_u16,
27452 servo11_raw: 0_u16,
27453 servo12_raw: 0_u16,
27454 servo13_raw: 0_u16,
27455 servo14_raw: 0_u16,
27456 servo15_raw: 0_u16,
27457 servo16_raw: 0_u16,
27458 };
27459 #[cfg(feature = "arbitrary")]
27460 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27461 use arbitrary::{Arbitrary, Unstructured};
27462 let mut buf = [0u8; 1024];
27463 rng.fill_bytes(&mut buf);
27464 let mut unstructured = Unstructured::new(&buf);
27465 Self::arbitrary(&mut unstructured).unwrap_or_default()
27466 }
27467}
27468impl Default for SERVO_OUTPUT_RAW_DATA {
27469 fn default() -> Self {
27470 Self::DEFAULT.clone()
27471 }
27472}
27473impl MessageData for SERVO_OUTPUT_RAW_DATA {
27474 type Message = MavMessage;
27475 const ID: u32 = 36u32;
27476 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27477 const EXTRA_CRC: u8 = 222u8;
27478 const ENCODED_LEN: usize = 37usize;
27479 fn deser(
27480 _version: MavlinkVersion,
27481 __input: &[u8],
27482 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27483 let avail_len = __input.len();
27484 let mut payload_buf = [0; Self::ENCODED_LEN];
27485 let mut buf = if avail_len < Self::ENCODED_LEN {
27486 payload_buf[0..avail_len].copy_from_slice(__input);
27487 Bytes::new(&payload_buf)
27488 } else {
27489 Bytes::new(__input)
27490 };
27491 let mut __struct = Self::default();
27492 __struct.time_usec = buf.get_u32_le()?;
27493 __struct.servo1_raw = buf.get_u16_le()?;
27494 __struct.servo2_raw = buf.get_u16_le()?;
27495 __struct.servo3_raw = buf.get_u16_le()?;
27496 __struct.servo4_raw = buf.get_u16_le()?;
27497 __struct.servo5_raw = buf.get_u16_le()?;
27498 __struct.servo6_raw = buf.get_u16_le()?;
27499 __struct.servo7_raw = buf.get_u16_le()?;
27500 __struct.servo8_raw = buf.get_u16_le()?;
27501 __struct.port = buf.get_u8()?;
27502 __struct.servo9_raw = buf.get_u16_le()?;
27503 __struct.servo10_raw = buf.get_u16_le()?;
27504 __struct.servo11_raw = buf.get_u16_le()?;
27505 __struct.servo12_raw = buf.get_u16_le()?;
27506 __struct.servo13_raw = buf.get_u16_le()?;
27507 __struct.servo14_raw = buf.get_u16_le()?;
27508 __struct.servo15_raw = buf.get_u16_le()?;
27509 __struct.servo16_raw = buf.get_u16_le()?;
27510 Ok(__struct)
27511 }
27512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27513 let mut __tmp = BytesMut::new(bytes);
27514 #[allow(clippy::absurd_extreme_comparisons)]
27515 #[allow(unused_comparisons)]
27516 if __tmp.remaining() < Self::ENCODED_LEN {
27517 panic!(
27518 "buffer is too small (need {} bytes, but got {})",
27519 Self::ENCODED_LEN,
27520 __tmp.remaining(),
27521 )
27522 }
27523 __tmp.put_u32_le(self.time_usec);
27524 __tmp.put_u16_le(self.servo1_raw);
27525 __tmp.put_u16_le(self.servo2_raw);
27526 __tmp.put_u16_le(self.servo3_raw);
27527 __tmp.put_u16_le(self.servo4_raw);
27528 __tmp.put_u16_le(self.servo5_raw);
27529 __tmp.put_u16_le(self.servo6_raw);
27530 __tmp.put_u16_le(self.servo7_raw);
27531 __tmp.put_u16_le(self.servo8_raw);
27532 __tmp.put_u8(self.port);
27533 if matches!(version, MavlinkVersion::V2) {
27534 __tmp.put_u16_le(self.servo9_raw);
27535 __tmp.put_u16_le(self.servo10_raw);
27536 __tmp.put_u16_le(self.servo11_raw);
27537 __tmp.put_u16_le(self.servo12_raw);
27538 __tmp.put_u16_le(self.servo13_raw);
27539 __tmp.put_u16_le(self.servo14_raw);
27540 __tmp.put_u16_le(self.servo15_raw);
27541 __tmp.put_u16_le(self.servo16_raw);
27542 let len = __tmp.len();
27543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27544 } else {
27545 __tmp.len()
27546 }
27547 }
27548}
27549#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27550#[doc = ""]
27551#[doc = "ID: 256"]
27552#[derive(Debug, Clone, PartialEq)]
27553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27555#[cfg_attr(feature = "ts", derive(TS))]
27556#[cfg_attr(feature = "ts", ts(export))]
27557pub struct SETUP_SIGNING_DATA {
27558 #[doc = "initial timestamp"]
27559 pub initial_timestamp: u64,
27560 #[doc = "system id of the target"]
27561 pub target_system: u8,
27562 #[doc = "component ID of the target"]
27563 pub target_component: u8,
27564 #[doc = "signing key"]
27565 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27566 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27567 pub secret_key: [u8; 32],
27568}
27569impl SETUP_SIGNING_DATA {
27570 pub const ENCODED_LEN: usize = 42usize;
27571 pub const DEFAULT: Self = Self {
27572 initial_timestamp: 0_u64,
27573 target_system: 0_u8,
27574 target_component: 0_u8,
27575 secret_key: [0_u8; 32usize],
27576 };
27577 #[cfg(feature = "arbitrary")]
27578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27579 use arbitrary::{Arbitrary, Unstructured};
27580 let mut buf = [0u8; 1024];
27581 rng.fill_bytes(&mut buf);
27582 let mut unstructured = Unstructured::new(&buf);
27583 Self::arbitrary(&mut unstructured).unwrap_or_default()
27584 }
27585}
27586impl Default for SETUP_SIGNING_DATA {
27587 fn default() -> Self {
27588 Self::DEFAULT.clone()
27589 }
27590}
27591impl MessageData for SETUP_SIGNING_DATA {
27592 type Message = MavMessage;
27593 const ID: u32 = 256u32;
27594 const NAME: &'static str = "SETUP_SIGNING";
27595 const EXTRA_CRC: u8 = 71u8;
27596 const ENCODED_LEN: usize = 42usize;
27597 fn deser(
27598 _version: MavlinkVersion,
27599 __input: &[u8],
27600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27601 let avail_len = __input.len();
27602 let mut payload_buf = [0; Self::ENCODED_LEN];
27603 let mut buf = if avail_len < Self::ENCODED_LEN {
27604 payload_buf[0..avail_len].copy_from_slice(__input);
27605 Bytes::new(&payload_buf)
27606 } else {
27607 Bytes::new(__input)
27608 };
27609 let mut __struct = Self::default();
27610 __struct.initial_timestamp = buf.get_u64_le()?;
27611 __struct.target_system = buf.get_u8()?;
27612 __struct.target_component = buf.get_u8()?;
27613 for v in &mut __struct.secret_key {
27614 let val = buf.get_u8()?;
27615 *v = val;
27616 }
27617 Ok(__struct)
27618 }
27619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27620 let mut __tmp = BytesMut::new(bytes);
27621 #[allow(clippy::absurd_extreme_comparisons)]
27622 #[allow(unused_comparisons)]
27623 if __tmp.remaining() < Self::ENCODED_LEN {
27624 panic!(
27625 "buffer is too small (need {} bytes, but got {})",
27626 Self::ENCODED_LEN,
27627 __tmp.remaining(),
27628 )
27629 }
27630 __tmp.put_u64_le(self.initial_timestamp);
27631 __tmp.put_u8(self.target_system);
27632 __tmp.put_u8(self.target_component);
27633 for val in &self.secret_key {
27634 __tmp.put_u8(*val);
27635 }
27636 if matches!(version, MavlinkVersion::V2) {
27637 let len = __tmp.len();
27638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27639 } else {
27640 __tmp.len()
27641 }
27642 }
27643}
27644#[doc = "Set the vehicle attitude and body angular rates."]
27645#[doc = ""]
27646#[doc = "ID: 139"]
27647#[derive(Debug, Clone, PartialEq)]
27648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27650#[cfg_attr(feature = "ts", derive(TS))]
27651#[cfg_attr(feature = "ts", ts(export))]
27652pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27653 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27654 pub time_usec: u64,
27655 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27656 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27657 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27658 pub controls: [f32; 8],
27659 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27660 pub group_mlx: u8,
27661 #[doc = "System ID"]
27662 pub target_system: u8,
27663 #[doc = "Component ID"]
27664 pub target_component: u8,
27665}
27666impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27667 pub const ENCODED_LEN: usize = 43usize;
27668 pub const DEFAULT: Self = Self {
27669 time_usec: 0_u64,
27670 controls: [0.0_f32; 8usize],
27671 group_mlx: 0_u8,
27672 target_system: 0_u8,
27673 target_component: 0_u8,
27674 };
27675 #[cfg(feature = "arbitrary")]
27676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27677 use arbitrary::{Arbitrary, Unstructured};
27678 let mut buf = [0u8; 1024];
27679 rng.fill_bytes(&mut buf);
27680 let mut unstructured = Unstructured::new(&buf);
27681 Self::arbitrary(&mut unstructured).unwrap_or_default()
27682 }
27683}
27684impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27685 fn default() -> Self {
27686 Self::DEFAULT.clone()
27687 }
27688}
27689impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27690 type Message = MavMessage;
27691 const ID: u32 = 139u32;
27692 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27693 const EXTRA_CRC: u8 = 168u8;
27694 const ENCODED_LEN: usize = 43usize;
27695 fn deser(
27696 _version: MavlinkVersion,
27697 __input: &[u8],
27698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27699 let avail_len = __input.len();
27700 let mut payload_buf = [0; Self::ENCODED_LEN];
27701 let mut buf = if avail_len < Self::ENCODED_LEN {
27702 payload_buf[0..avail_len].copy_from_slice(__input);
27703 Bytes::new(&payload_buf)
27704 } else {
27705 Bytes::new(__input)
27706 };
27707 let mut __struct = Self::default();
27708 __struct.time_usec = buf.get_u64_le()?;
27709 for v in &mut __struct.controls {
27710 let val = buf.get_f32_le()?;
27711 *v = val;
27712 }
27713 __struct.group_mlx = buf.get_u8()?;
27714 __struct.target_system = buf.get_u8()?;
27715 __struct.target_component = buf.get_u8()?;
27716 Ok(__struct)
27717 }
27718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27719 let mut __tmp = BytesMut::new(bytes);
27720 #[allow(clippy::absurd_extreme_comparisons)]
27721 #[allow(unused_comparisons)]
27722 if __tmp.remaining() < Self::ENCODED_LEN {
27723 panic!(
27724 "buffer is too small (need {} bytes, but got {})",
27725 Self::ENCODED_LEN,
27726 __tmp.remaining(),
27727 )
27728 }
27729 __tmp.put_u64_le(self.time_usec);
27730 for val in &self.controls {
27731 __tmp.put_f32_le(*val);
27732 }
27733 __tmp.put_u8(self.group_mlx);
27734 __tmp.put_u8(self.target_system);
27735 __tmp.put_u8(self.target_component);
27736 if matches!(version, MavlinkVersion::V2) {
27737 let len = __tmp.len();
27738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27739 } else {
27740 __tmp.len()
27741 }
27742 }
27743}
27744#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27745#[doc = ""]
27746#[doc = "ID: 82"]
27747#[derive(Debug, Clone, PartialEq)]
27748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27750#[cfg_attr(feature = "ts", derive(TS))]
27751#[cfg_attr(feature = "ts", ts(export))]
27752pub struct SET_ATTITUDE_TARGET_DATA {
27753 #[doc = "Timestamp (time since system boot)."]
27754 pub time_boot_ms: u32,
27755 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27756 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27757 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27758 pub q: [f32; 4],
27759 #[doc = "Body roll rate"]
27760 pub body_roll_rate: f32,
27761 #[doc = "Body pitch rate"]
27762 pub body_pitch_rate: f32,
27763 #[doc = "Body yaw rate"]
27764 pub body_yaw_rate: f32,
27765 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27766 pub thrust: f32,
27767 #[doc = "System ID"]
27768 pub target_system: u8,
27769 #[doc = "Component ID"]
27770 pub target_component: u8,
27771 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27772 pub type_mask: AttitudeTargetTypemask,
27773 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27776 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27777 pub thrust_body: [f32; 3],
27778}
27779impl SET_ATTITUDE_TARGET_DATA {
27780 pub const ENCODED_LEN: usize = 51usize;
27781 pub const DEFAULT: Self = Self {
27782 time_boot_ms: 0_u32,
27783 q: [0.0_f32; 4usize],
27784 body_roll_rate: 0.0_f32,
27785 body_pitch_rate: 0.0_f32,
27786 body_yaw_rate: 0.0_f32,
27787 thrust: 0.0_f32,
27788 target_system: 0_u8,
27789 target_component: 0_u8,
27790 type_mask: AttitudeTargetTypemask::DEFAULT,
27791 thrust_body: [0.0_f32; 3usize],
27792 };
27793 #[cfg(feature = "arbitrary")]
27794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27795 use arbitrary::{Arbitrary, Unstructured};
27796 let mut buf = [0u8; 1024];
27797 rng.fill_bytes(&mut buf);
27798 let mut unstructured = Unstructured::new(&buf);
27799 Self::arbitrary(&mut unstructured).unwrap_or_default()
27800 }
27801}
27802impl Default for SET_ATTITUDE_TARGET_DATA {
27803 fn default() -> Self {
27804 Self::DEFAULT.clone()
27805 }
27806}
27807impl MessageData for SET_ATTITUDE_TARGET_DATA {
27808 type Message = MavMessage;
27809 const ID: u32 = 82u32;
27810 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27811 const EXTRA_CRC: u8 = 49u8;
27812 const ENCODED_LEN: usize = 51usize;
27813 fn deser(
27814 _version: MavlinkVersion,
27815 __input: &[u8],
27816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27817 let avail_len = __input.len();
27818 let mut payload_buf = [0; Self::ENCODED_LEN];
27819 let mut buf = if avail_len < Self::ENCODED_LEN {
27820 payload_buf[0..avail_len].copy_from_slice(__input);
27821 Bytes::new(&payload_buf)
27822 } else {
27823 Bytes::new(__input)
27824 };
27825 let mut __struct = Self::default();
27826 __struct.time_boot_ms = buf.get_u32_le()?;
27827 for v in &mut __struct.q {
27828 let val = buf.get_f32_le()?;
27829 *v = val;
27830 }
27831 __struct.body_roll_rate = buf.get_f32_le()?;
27832 __struct.body_pitch_rate = buf.get_f32_le()?;
27833 __struct.body_yaw_rate = buf.get_f32_le()?;
27834 __struct.thrust = buf.get_f32_le()?;
27835 __struct.target_system = buf.get_u8()?;
27836 __struct.target_component = buf.get_u8()?;
27837 let tmp = buf.get_u8()?;
27838 __struct.type_mask =
27839 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
27840 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27841 flag_type: "AttitudeTargetTypemask",
27842 value: tmp as u64,
27843 })?;
27844 for v in &mut __struct.thrust_body {
27845 let val = buf.get_f32_le()?;
27846 *v = val;
27847 }
27848 Ok(__struct)
27849 }
27850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27851 let mut __tmp = BytesMut::new(bytes);
27852 #[allow(clippy::absurd_extreme_comparisons)]
27853 #[allow(unused_comparisons)]
27854 if __tmp.remaining() < Self::ENCODED_LEN {
27855 panic!(
27856 "buffer is too small (need {} bytes, but got {})",
27857 Self::ENCODED_LEN,
27858 __tmp.remaining(),
27859 )
27860 }
27861 __tmp.put_u32_le(self.time_boot_ms);
27862 for val in &self.q {
27863 __tmp.put_f32_le(*val);
27864 }
27865 __tmp.put_f32_le(self.body_roll_rate);
27866 __tmp.put_f32_le(self.body_pitch_rate);
27867 __tmp.put_f32_le(self.body_yaw_rate);
27868 __tmp.put_f32_le(self.thrust);
27869 __tmp.put_u8(self.target_system);
27870 __tmp.put_u8(self.target_component);
27871 __tmp.put_u8(self.type_mask.bits() as u8);
27872 if matches!(version, MavlinkVersion::V2) {
27873 for val in &self.thrust_body {
27874 __tmp.put_f32_le(*val);
27875 }
27876 let len = __tmp.len();
27877 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27878 } else {
27879 __tmp.len()
27880 }
27881 }
27882}
27883#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27884#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27885#[doc = ""]
27886#[doc = "ID: 48"]
27887#[derive(Debug, Clone, PartialEq)]
27888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27890#[cfg_attr(feature = "ts", derive(TS))]
27891#[cfg_attr(feature = "ts", ts(export))]
27892pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27893 #[doc = "Latitude (WGS84)"]
27894 pub latitude: i32,
27895 #[doc = "Longitude (WGS84)"]
27896 pub longitude: i32,
27897 #[doc = "Altitude (MSL). Positive for up."]
27898 pub altitude: i32,
27899 #[doc = "System ID"]
27900 pub target_system: u8,
27901 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27902 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27903 pub time_usec: u64,
27904}
27905impl SET_GPS_GLOBAL_ORIGIN_DATA {
27906 pub const ENCODED_LEN: usize = 21usize;
27907 pub const DEFAULT: Self = Self {
27908 latitude: 0_i32,
27909 longitude: 0_i32,
27910 altitude: 0_i32,
27911 target_system: 0_u8,
27912 time_usec: 0_u64,
27913 };
27914 #[cfg(feature = "arbitrary")]
27915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27916 use arbitrary::{Arbitrary, Unstructured};
27917 let mut buf = [0u8; 1024];
27918 rng.fill_bytes(&mut buf);
27919 let mut unstructured = Unstructured::new(&buf);
27920 Self::arbitrary(&mut unstructured).unwrap_or_default()
27921 }
27922}
27923impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27924 fn default() -> Self {
27925 Self::DEFAULT.clone()
27926 }
27927}
27928impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27929 type Message = MavMessage;
27930 const ID: u32 = 48u32;
27931 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27932 const EXTRA_CRC: u8 = 41u8;
27933 const ENCODED_LEN: usize = 21usize;
27934 fn deser(
27935 _version: MavlinkVersion,
27936 __input: &[u8],
27937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27938 let avail_len = __input.len();
27939 let mut payload_buf = [0; Self::ENCODED_LEN];
27940 let mut buf = if avail_len < Self::ENCODED_LEN {
27941 payload_buf[0..avail_len].copy_from_slice(__input);
27942 Bytes::new(&payload_buf)
27943 } else {
27944 Bytes::new(__input)
27945 };
27946 let mut __struct = Self::default();
27947 __struct.latitude = buf.get_i32_le()?;
27948 __struct.longitude = buf.get_i32_le()?;
27949 __struct.altitude = buf.get_i32_le()?;
27950 __struct.target_system = buf.get_u8()?;
27951 __struct.time_usec = buf.get_u64_le()?;
27952 Ok(__struct)
27953 }
27954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27955 let mut __tmp = BytesMut::new(bytes);
27956 #[allow(clippy::absurd_extreme_comparisons)]
27957 #[allow(unused_comparisons)]
27958 if __tmp.remaining() < Self::ENCODED_LEN {
27959 panic!(
27960 "buffer is too small (need {} bytes, but got {})",
27961 Self::ENCODED_LEN,
27962 __tmp.remaining(),
27963 )
27964 }
27965 __tmp.put_i32_le(self.latitude);
27966 __tmp.put_i32_le(self.longitude);
27967 __tmp.put_i32_le(self.altitude);
27968 __tmp.put_u8(self.target_system);
27969 if matches!(version, MavlinkVersion::V2) {
27970 __tmp.put_u64_le(self.time_usec);
27971 let len = __tmp.len();
27972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27973 } else {
27974 __tmp.len()
27975 }
27976 }
27977}
27978#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27979#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27980#[doc = ""]
27981#[doc = "ID: 243"]
27982#[derive(Debug, Clone, PartialEq)]
27983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27985#[cfg_attr(feature = "ts", derive(TS))]
27986#[cfg_attr(feature = "ts", ts(export))]
27987pub struct SET_HOME_POSITION_DATA {
27988 #[doc = "Latitude (WGS84)"]
27989 pub latitude: i32,
27990 #[doc = "Longitude (WGS84)"]
27991 pub longitude: i32,
27992 #[doc = "Altitude (MSL). Positive for up."]
27993 pub altitude: i32,
27994 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27995 pub x: f32,
27996 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27997 pub y: f32,
27998 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27999 pub z: f32,
28000 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28001 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28002 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28003 pub q: [f32; 4],
28004 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28005 pub approach_x: f32,
28006 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28007 pub approach_y: f32,
28008 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28009 pub approach_z: f32,
28010 #[doc = "System ID."]
28011 pub target_system: u8,
28012 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28013 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28014 pub time_usec: u64,
28015}
28016impl SET_HOME_POSITION_DATA {
28017 pub const ENCODED_LEN: usize = 61usize;
28018 pub const DEFAULT: Self = Self {
28019 latitude: 0_i32,
28020 longitude: 0_i32,
28021 altitude: 0_i32,
28022 x: 0.0_f32,
28023 y: 0.0_f32,
28024 z: 0.0_f32,
28025 q: [0.0_f32; 4usize],
28026 approach_x: 0.0_f32,
28027 approach_y: 0.0_f32,
28028 approach_z: 0.0_f32,
28029 target_system: 0_u8,
28030 time_usec: 0_u64,
28031 };
28032 #[cfg(feature = "arbitrary")]
28033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28034 use arbitrary::{Arbitrary, Unstructured};
28035 let mut buf = [0u8; 1024];
28036 rng.fill_bytes(&mut buf);
28037 let mut unstructured = Unstructured::new(&buf);
28038 Self::arbitrary(&mut unstructured).unwrap_or_default()
28039 }
28040}
28041impl Default for SET_HOME_POSITION_DATA {
28042 fn default() -> Self {
28043 Self::DEFAULT.clone()
28044 }
28045}
28046impl MessageData for SET_HOME_POSITION_DATA {
28047 type Message = MavMessage;
28048 const ID: u32 = 243u32;
28049 const NAME: &'static str = "SET_HOME_POSITION";
28050 const EXTRA_CRC: u8 = 85u8;
28051 const ENCODED_LEN: usize = 61usize;
28052 fn deser(
28053 _version: MavlinkVersion,
28054 __input: &[u8],
28055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28056 let avail_len = __input.len();
28057 let mut payload_buf = [0; Self::ENCODED_LEN];
28058 let mut buf = if avail_len < Self::ENCODED_LEN {
28059 payload_buf[0..avail_len].copy_from_slice(__input);
28060 Bytes::new(&payload_buf)
28061 } else {
28062 Bytes::new(__input)
28063 };
28064 let mut __struct = Self::default();
28065 __struct.latitude = buf.get_i32_le()?;
28066 __struct.longitude = buf.get_i32_le()?;
28067 __struct.altitude = buf.get_i32_le()?;
28068 __struct.x = buf.get_f32_le()?;
28069 __struct.y = buf.get_f32_le()?;
28070 __struct.z = buf.get_f32_le()?;
28071 for v in &mut __struct.q {
28072 let val = buf.get_f32_le()?;
28073 *v = val;
28074 }
28075 __struct.approach_x = buf.get_f32_le()?;
28076 __struct.approach_y = buf.get_f32_le()?;
28077 __struct.approach_z = buf.get_f32_le()?;
28078 __struct.target_system = buf.get_u8()?;
28079 __struct.time_usec = buf.get_u64_le()?;
28080 Ok(__struct)
28081 }
28082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28083 let mut __tmp = BytesMut::new(bytes);
28084 #[allow(clippy::absurd_extreme_comparisons)]
28085 #[allow(unused_comparisons)]
28086 if __tmp.remaining() < Self::ENCODED_LEN {
28087 panic!(
28088 "buffer is too small (need {} bytes, but got {})",
28089 Self::ENCODED_LEN,
28090 __tmp.remaining(),
28091 )
28092 }
28093 __tmp.put_i32_le(self.latitude);
28094 __tmp.put_i32_le(self.longitude);
28095 __tmp.put_i32_le(self.altitude);
28096 __tmp.put_f32_le(self.x);
28097 __tmp.put_f32_le(self.y);
28098 __tmp.put_f32_le(self.z);
28099 for val in &self.q {
28100 __tmp.put_f32_le(*val);
28101 }
28102 __tmp.put_f32_le(self.approach_x);
28103 __tmp.put_f32_le(self.approach_y);
28104 __tmp.put_f32_le(self.approach_z);
28105 __tmp.put_u8(self.target_system);
28106 if matches!(version, MavlinkVersion::V2) {
28107 __tmp.put_u64_le(self.time_usec);
28108 let len = __tmp.len();
28109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28110 } else {
28111 __tmp.len()
28112 }
28113 }
28114}
28115#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28116#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28117#[doc = ""]
28118#[doc = "ID: 11"]
28119#[derive(Debug, Clone, PartialEq)]
28120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28122#[cfg_attr(feature = "ts", derive(TS))]
28123#[cfg_attr(feature = "ts", ts(export))]
28124pub struct SET_MODE_DATA {
28125 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28126 pub custom_mode: u32,
28127 #[doc = "The system setting the mode"]
28128 pub target_system: u8,
28129 #[doc = "The new base mode."]
28130 pub base_mode: MavMode,
28131}
28132impl SET_MODE_DATA {
28133 pub const ENCODED_LEN: usize = 6usize;
28134 pub const DEFAULT: Self = Self {
28135 custom_mode: 0_u32,
28136 target_system: 0_u8,
28137 base_mode: MavMode::DEFAULT,
28138 };
28139 #[cfg(feature = "arbitrary")]
28140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28141 use arbitrary::{Arbitrary, Unstructured};
28142 let mut buf = [0u8; 1024];
28143 rng.fill_bytes(&mut buf);
28144 let mut unstructured = Unstructured::new(&buf);
28145 Self::arbitrary(&mut unstructured).unwrap_or_default()
28146 }
28147}
28148impl Default for SET_MODE_DATA {
28149 fn default() -> Self {
28150 Self::DEFAULT.clone()
28151 }
28152}
28153impl MessageData for SET_MODE_DATA {
28154 type Message = MavMessage;
28155 const ID: u32 = 11u32;
28156 const NAME: &'static str = "SET_MODE";
28157 const EXTRA_CRC: u8 = 89u8;
28158 const ENCODED_LEN: usize = 6usize;
28159 fn deser(
28160 _version: MavlinkVersion,
28161 __input: &[u8],
28162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28163 let avail_len = __input.len();
28164 let mut payload_buf = [0; Self::ENCODED_LEN];
28165 let mut buf = if avail_len < Self::ENCODED_LEN {
28166 payload_buf[0..avail_len].copy_from_slice(__input);
28167 Bytes::new(&payload_buf)
28168 } else {
28169 Bytes::new(__input)
28170 };
28171 let mut __struct = Self::default();
28172 __struct.custom_mode = buf.get_u32_le()?;
28173 __struct.target_system = buf.get_u8()?;
28174 let tmp = buf.get_u8()?;
28175 __struct.base_mode =
28176 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28177 enum_type: "MavMode",
28178 value: tmp as u64,
28179 })?;
28180 Ok(__struct)
28181 }
28182 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28183 let mut __tmp = BytesMut::new(bytes);
28184 #[allow(clippy::absurd_extreme_comparisons)]
28185 #[allow(unused_comparisons)]
28186 if __tmp.remaining() < Self::ENCODED_LEN {
28187 panic!(
28188 "buffer is too small (need {} bytes, but got {})",
28189 Self::ENCODED_LEN,
28190 __tmp.remaining(),
28191 )
28192 }
28193 __tmp.put_u32_le(self.custom_mode);
28194 __tmp.put_u8(self.target_system);
28195 __tmp.put_u8(self.base_mode as u8);
28196 if matches!(version, MavlinkVersion::V2) {
28197 let len = __tmp.len();
28198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28199 } else {
28200 __tmp.len()
28201 }
28202 }
28203}
28204#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28205#[doc = ""]
28206#[doc = "ID: 86"]
28207#[derive(Debug, Clone, PartialEq)]
28208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28210#[cfg_attr(feature = "ts", derive(TS))]
28211#[cfg_attr(feature = "ts", ts(export))]
28212pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28213 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28214 pub time_boot_ms: u32,
28215 #[doc = "Latitude in WGS84 frame"]
28216 pub lat_int: i32,
28217 #[doc = "Longitude in WGS84 frame"]
28218 pub lon_int: i32,
28219 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28220 pub alt: f32,
28221 #[doc = "X velocity in NED frame"]
28222 pub vx: f32,
28223 #[doc = "Y velocity in NED frame"]
28224 pub vy: f32,
28225 #[doc = "Z velocity in NED frame"]
28226 pub vz: f32,
28227 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28228 pub afx: f32,
28229 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28230 pub afy: f32,
28231 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28232 pub afz: f32,
28233 #[doc = "yaw setpoint"]
28234 pub yaw: f32,
28235 #[doc = "yaw rate setpoint"]
28236 pub yaw_rate: f32,
28237 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28238 pub type_mask: PositionTargetTypemask,
28239 #[doc = "System ID"]
28240 pub target_system: u8,
28241 #[doc = "Component ID"]
28242 pub target_component: u8,
28243 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28244 pub coordinate_frame: MavFrame,
28245}
28246impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28247 pub const ENCODED_LEN: usize = 53usize;
28248 pub const DEFAULT: Self = Self {
28249 time_boot_ms: 0_u32,
28250 lat_int: 0_i32,
28251 lon_int: 0_i32,
28252 alt: 0.0_f32,
28253 vx: 0.0_f32,
28254 vy: 0.0_f32,
28255 vz: 0.0_f32,
28256 afx: 0.0_f32,
28257 afy: 0.0_f32,
28258 afz: 0.0_f32,
28259 yaw: 0.0_f32,
28260 yaw_rate: 0.0_f32,
28261 type_mask: PositionTargetTypemask::DEFAULT,
28262 target_system: 0_u8,
28263 target_component: 0_u8,
28264 coordinate_frame: MavFrame::DEFAULT,
28265 };
28266 #[cfg(feature = "arbitrary")]
28267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28268 use arbitrary::{Arbitrary, Unstructured};
28269 let mut buf = [0u8; 1024];
28270 rng.fill_bytes(&mut buf);
28271 let mut unstructured = Unstructured::new(&buf);
28272 Self::arbitrary(&mut unstructured).unwrap_or_default()
28273 }
28274}
28275impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28276 fn default() -> Self {
28277 Self::DEFAULT.clone()
28278 }
28279}
28280impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28281 type Message = MavMessage;
28282 const ID: u32 = 86u32;
28283 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28284 const EXTRA_CRC: u8 = 5u8;
28285 const ENCODED_LEN: usize = 53usize;
28286 fn deser(
28287 _version: MavlinkVersion,
28288 __input: &[u8],
28289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28290 let avail_len = __input.len();
28291 let mut payload_buf = [0; Self::ENCODED_LEN];
28292 let mut buf = if avail_len < Self::ENCODED_LEN {
28293 payload_buf[0..avail_len].copy_from_slice(__input);
28294 Bytes::new(&payload_buf)
28295 } else {
28296 Bytes::new(__input)
28297 };
28298 let mut __struct = Self::default();
28299 __struct.time_boot_ms = buf.get_u32_le()?;
28300 __struct.lat_int = buf.get_i32_le()?;
28301 __struct.lon_int = buf.get_i32_le()?;
28302 __struct.alt = buf.get_f32_le()?;
28303 __struct.vx = buf.get_f32_le()?;
28304 __struct.vy = buf.get_f32_le()?;
28305 __struct.vz = buf.get_f32_le()?;
28306 __struct.afx = buf.get_f32_le()?;
28307 __struct.afy = buf.get_f32_le()?;
28308 __struct.afz = buf.get_f32_le()?;
28309 __struct.yaw = buf.get_f32_le()?;
28310 __struct.yaw_rate = buf.get_f32_le()?;
28311 let tmp = buf.get_u16_le()?;
28312 __struct.type_mask =
28313 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28314 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28315 flag_type: "PositionTargetTypemask",
28316 value: tmp as u64,
28317 })?;
28318 __struct.target_system = buf.get_u8()?;
28319 __struct.target_component = buf.get_u8()?;
28320 let tmp = buf.get_u8()?;
28321 __struct.coordinate_frame =
28322 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28323 enum_type: "MavFrame",
28324 value: tmp as u64,
28325 })?;
28326 Ok(__struct)
28327 }
28328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28329 let mut __tmp = BytesMut::new(bytes);
28330 #[allow(clippy::absurd_extreme_comparisons)]
28331 #[allow(unused_comparisons)]
28332 if __tmp.remaining() < Self::ENCODED_LEN {
28333 panic!(
28334 "buffer is too small (need {} bytes, but got {})",
28335 Self::ENCODED_LEN,
28336 __tmp.remaining(),
28337 )
28338 }
28339 __tmp.put_u32_le(self.time_boot_ms);
28340 __tmp.put_i32_le(self.lat_int);
28341 __tmp.put_i32_le(self.lon_int);
28342 __tmp.put_f32_le(self.alt);
28343 __tmp.put_f32_le(self.vx);
28344 __tmp.put_f32_le(self.vy);
28345 __tmp.put_f32_le(self.vz);
28346 __tmp.put_f32_le(self.afx);
28347 __tmp.put_f32_le(self.afy);
28348 __tmp.put_f32_le(self.afz);
28349 __tmp.put_f32_le(self.yaw);
28350 __tmp.put_f32_le(self.yaw_rate);
28351 __tmp.put_u16_le(self.type_mask.bits() as u16);
28352 __tmp.put_u8(self.target_system);
28353 __tmp.put_u8(self.target_component);
28354 __tmp.put_u8(self.coordinate_frame as u8);
28355 if matches!(version, MavlinkVersion::V2) {
28356 let len = __tmp.len();
28357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28358 } else {
28359 __tmp.len()
28360 }
28361 }
28362}
28363#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28364#[doc = ""]
28365#[doc = "ID: 84"]
28366#[derive(Debug, Clone, PartialEq)]
28367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28369#[cfg_attr(feature = "ts", derive(TS))]
28370#[cfg_attr(feature = "ts", ts(export))]
28371pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28372 #[doc = "Timestamp (time since system boot)."]
28373 pub time_boot_ms: u32,
28374 #[doc = "X Position in NED frame"]
28375 pub x: f32,
28376 #[doc = "Y Position in NED frame"]
28377 pub y: f32,
28378 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28379 pub z: f32,
28380 #[doc = "X velocity in NED frame"]
28381 pub vx: f32,
28382 #[doc = "Y velocity in NED frame"]
28383 pub vy: f32,
28384 #[doc = "Z velocity in NED frame"]
28385 pub vz: f32,
28386 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28387 pub afx: f32,
28388 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28389 pub afy: f32,
28390 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28391 pub afz: f32,
28392 #[doc = "yaw setpoint"]
28393 pub yaw: f32,
28394 #[doc = "yaw rate setpoint"]
28395 pub yaw_rate: f32,
28396 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28397 pub type_mask: PositionTargetTypemask,
28398 #[doc = "System ID"]
28399 pub target_system: u8,
28400 #[doc = "Component ID"]
28401 pub target_component: u8,
28402 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28403 pub coordinate_frame: MavFrame,
28404}
28405impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28406 pub const ENCODED_LEN: usize = 53usize;
28407 pub const DEFAULT: Self = Self {
28408 time_boot_ms: 0_u32,
28409 x: 0.0_f32,
28410 y: 0.0_f32,
28411 z: 0.0_f32,
28412 vx: 0.0_f32,
28413 vy: 0.0_f32,
28414 vz: 0.0_f32,
28415 afx: 0.0_f32,
28416 afy: 0.0_f32,
28417 afz: 0.0_f32,
28418 yaw: 0.0_f32,
28419 yaw_rate: 0.0_f32,
28420 type_mask: PositionTargetTypemask::DEFAULT,
28421 target_system: 0_u8,
28422 target_component: 0_u8,
28423 coordinate_frame: MavFrame::DEFAULT,
28424 };
28425 #[cfg(feature = "arbitrary")]
28426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28427 use arbitrary::{Arbitrary, Unstructured};
28428 let mut buf = [0u8; 1024];
28429 rng.fill_bytes(&mut buf);
28430 let mut unstructured = Unstructured::new(&buf);
28431 Self::arbitrary(&mut unstructured).unwrap_or_default()
28432 }
28433}
28434impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28435 fn default() -> Self {
28436 Self::DEFAULT.clone()
28437 }
28438}
28439impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28440 type Message = MavMessage;
28441 const ID: u32 = 84u32;
28442 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28443 const EXTRA_CRC: u8 = 143u8;
28444 const ENCODED_LEN: usize = 53usize;
28445 fn deser(
28446 _version: MavlinkVersion,
28447 __input: &[u8],
28448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28449 let avail_len = __input.len();
28450 let mut payload_buf = [0; Self::ENCODED_LEN];
28451 let mut buf = if avail_len < Self::ENCODED_LEN {
28452 payload_buf[0..avail_len].copy_from_slice(__input);
28453 Bytes::new(&payload_buf)
28454 } else {
28455 Bytes::new(__input)
28456 };
28457 let mut __struct = Self::default();
28458 __struct.time_boot_ms = buf.get_u32_le()?;
28459 __struct.x = buf.get_f32_le()?;
28460 __struct.y = buf.get_f32_le()?;
28461 __struct.z = buf.get_f32_le()?;
28462 __struct.vx = buf.get_f32_le()?;
28463 __struct.vy = buf.get_f32_le()?;
28464 __struct.vz = buf.get_f32_le()?;
28465 __struct.afx = buf.get_f32_le()?;
28466 __struct.afy = buf.get_f32_le()?;
28467 __struct.afz = buf.get_f32_le()?;
28468 __struct.yaw = buf.get_f32_le()?;
28469 __struct.yaw_rate = buf.get_f32_le()?;
28470 let tmp = buf.get_u16_le()?;
28471 __struct.type_mask =
28472 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
28473 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28474 flag_type: "PositionTargetTypemask",
28475 value: tmp as u64,
28476 })?;
28477 __struct.target_system = buf.get_u8()?;
28478 __struct.target_component = buf.get_u8()?;
28479 let tmp = buf.get_u8()?;
28480 __struct.coordinate_frame =
28481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28482 enum_type: "MavFrame",
28483 value: tmp as u64,
28484 })?;
28485 Ok(__struct)
28486 }
28487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28488 let mut __tmp = BytesMut::new(bytes);
28489 #[allow(clippy::absurd_extreme_comparisons)]
28490 #[allow(unused_comparisons)]
28491 if __tmp.remaining() < Self::ENCODED_LEN {
28492 panic!(
28493 "buffer is too small (need {} bytes, but got {})",
28494 Self::ENCODED_LEN,
28495 __tmp.remaining(),
28496 )
28497 }
28498 __tmp.put_u32_le(self.time_boot_ms);
28499 __tmp.put_f32_le(self.x);
28500 __tmp.put_f32_le(self.y);
28501 __tmp.put_f32_le(self.z);
28502 __tmp.put_f32_le(self.vx);
28503 __tmp.put_f32_le(self.vy);
28504 __tmp.put_f32_le(self.vz);
28505 __tmp.put_f32_le(self.afx);
28506 __tmp.put_f32_le(self.afy);
28507 __tmp.put_f32_le(self.afz);
28508 __tmp.put_f32_le(self.yaw);
28509 __tmp.put_f32_le(self.yaw_rate);
28510 __tmp.put_u16_le(self.type_mask.bits() as u16);
28511 __tmp.put_u8(self.target_system);
28512 __tmp.put_u8(self.target_component);
28513 __tmp.put_u8(self.coordinate_frame as u8);
28514 if matches!(version, MavlinkVersion::V2) {
28515 let len = __tmp.len();
28516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28517 } else {
28518 __tmp.len()
28519 }
28520 }
28521}
28522#[doc = "Status of simulation environment, if used."]
28523#[doc = ""]
28524#[doc = "ID: 108"]
28525#[derive(Debug, Clone, PartialEq)]
28526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28528#[cfg_attr(feature = "ts", derive(TS))]
28529#[cfg_attr(feature = "ts", ts(export))]
28530pub struct SIM_STATE_DATA {
28531 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28532 pub q1: f32,
28533 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28534 pub q2: f32,
28535 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28536 pub q3: f32,
28537 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28538 pub q4: f32,
28539 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28540 pub roll: f32,
28541 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28542 pub pitch: f32,
28543 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28544 pub yaw: f32,
28545 #[doc = "X acceleration"]
28546 pub xacc: f32,
28547 #[doc = "Y acceleration"]
28548 pub yacc: f32,
28549 #[doc = "Z acceleration"]
28550 pub zacc: f32,
28551 #[doc = "Angular speed around X axis"]
28552 pub xgyro: f32,
28553 #[doc = "Angular speed around Y axis"]
28554 pub ygyro: f32,
28555 #[doc = "Angular speed around Z axis"]
28556 pub zgyro: f32,
28557 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28558 pub lat: f32,
28559 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28560 pub lon: f32,
28561 #[doc = "Altitude"]
28562 pub alt: f32,
28563 #[doc = "Horizontal position standard deviation"]
28564 pub std_dev_horz: f32,
28565 #[doc = "Vertical position standard deviation"]
28566 pub std_dev_vert: f32,
28567 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28568 pub vn: f32,
28569 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28570 pub ve: f32,
28571 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28572 pub vd: f32,
28573 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28574 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28575 pub lat_int: i32,
28576 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28577 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28578 pub lon_int: i32,
28579}
28580impl SIM_STATE_DATA {
28581 pub const ENCODED_LEN: usize = 92usize;
28582 pub const DEFAULT: Self = Self {
28583 q1: 0.0_f32,
28584 q2: 0.0_f32,
28585 q3: 0.0_f32,
28586 q4: 0.0_f32,
28587 roll: 0.0_f32,
28588 pitch: 0.0_f32,
28589 yaw: 0.0_f32,
28590 xacc: 0.0_f32,
28591 yacc: 0.0_f32,
28592 zacc: 0.0_f32,
28593 xgyro: 0.0_f32,
28594 ygyro: 0.0_f32,
28595 zgyro: 0.0_f32,
28596 lat: 0.0_f32,
28597 lon: 0.0_f32,
28598 alt: 0.0_f32,
28599 std_dev_horz: 0.0_f32,
28600 std_dev_vert: 0.0_f32,
28601 vn: 0.0_f32,
28602 ve: 0.0_f32,
28603 vd: 0.0_f32,
28604 lat_int: 0_i32,
28605 lon_int: 0_i32,
28606 };
28607 #[cfg(feature = "arbitrary")]
28608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28609 use arbitrary::{Arbitrary, Unstructured};
28610 let mut buf = [0u8; 1024];
28611 rng.fill_bytes(&mut buf);
28612 let mut unstructured = Unstructured::new(&buf);
28613 Self::arbitrary(&mut unstructured).unwrap_or_default()
28614 }
28615}
28616impl Default for SIM_STATE_DATA {
28617 fn default() -> Self {
28618 Self::DEFAULT.clone()
28619 }
28620}
28621impl MessageData for SIM_STATE_DATA {
28622 type Message = MavMessage;
28623 const ID: u32 = 108u32;
28624 const NAME: &'static str = "SIM_STATE";
28625 const EXTRA_CRC: u8 = 32u8;
28626 const ENCODED_LEN: usize = 92usize;
28627 fn deser(
28628 _version: MavlinkVersion,
28629 __input: &[u8],
28630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28631 let avail_len = __input.len();
28632 let mut payload_buf = [0; Self::ENCODED_LEN];
28633 let mut buf = if avail_len < Self::ENCODED_LEN {
28634 payload_buf[0..avail_len].copy_from_slice(__input);
28635 Bytes::new(&payload_buf)
28636 } else {
28637 Bytes::new(__input)
28638 };
28639 let mut __struct = Self::default();
28640 __struct.q1 = buf.get_f32_le()?;
28641 __struct.q2 = buf.get_f32_le()?;
28642 __struct.q3 = buf.get_f32_le()?;
28643 __struct.q4 = buf.get_f32_le()?;
28644 __struct.roll = buf.get_f32_le()?;
28645 __struct.pitch = buf.get_f32_le()?;
28646 __struct.yaw = buf.get_f32_le()?;
28647 __struct.xacc = buf.get_f32_le()?;
28648 __struct.yacc = buf.get_f32_le()?;
28649 __struct.zacc = buf.get_f32_le()?;
28650 __struct.xgyro = buf.get_f32_le()?;
28651 __struct.ygyro = buf.get_f32_le()?;
28652 __struct.zgyro = buf.get_f32_le()?;
28653 __struct.lat = buf.get_f32_le()?;
28654 __struct.lon = buf.get_f32_le()?;
28655 __struct.alt = buf.get_f32_le()?;
28656 __struct.std_dev_horz = buf.get_f32_le()?;
28657 __struct.std_dev_vert = buf.get_f32_le()?;
28658 __struct.vn = buf.get_f32_le()?;
28659 __struct.ve = buf.get_f32_le()?;
28660 __struct.vd = buf.get_f32_le()?;
28661 __struct.lat_int = buf.get_i32_le()?;
28662 __struct.lon_int = buf.get_i32_le()?;
28663 Ok(__struct)
28664 }
28665 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28666 let mut __tmp = BytesMut::new(bytes);
28667 #[allow(clippy::absurd_extreme_comparisons)]
28668 #[allow(unused_comparisons)]
28669 if __tmp.remaining() < Self::ENCODED_LEN {
28670 panic!(
28671 "buffer is too small (need {} bytes, but got {})",
28672 Self::ENCODED_LEN,
28673 __tmp.remaining(),
28674 )
28675 }
28676 __tmp.put_f32_le(self.q1);
28677 __tmp.put_f32_le(self.q2);
28678 __tmp.put_f32_le(self.q3);
28679 __tmp.put_f32_le(self.q4);
28680 __tmp.put_f32_le(self.roll);
28681 __tmp.put_f32_le(self.pitch);
28682 __tmp.put_f32_le(self.yaw);
28683 __tmp.put_f32_le(self.xacc);
28684 __tmp.put_f32_le(self.yacc);
28685 __tmp.put_f32_le(self.zacc);
28686 __tmp.put_f32_le(self.xgyro);
28687 __tmp.put_f32_le(self.ygyro);
28688 __tmp.put_f32_le(self.zgyro);
28689 __tmp.put_f32_le(self.lat);
28690 __tmp.put_f32_le(self.lon);
28691 __tmp.put_f32_le(self.alt);
28692 __tmp.put_f32_le(self.std_dev_horz);
28693 __tmp.put_f32_le(self.std_dev_vert);
28694 __tmp.put_f32_le(self.vn);
28695 __tmp.put_f32_le(self.ve);
28696 __tmp.put_f32_le(self.vd);
28697 if matches!(version, MavlinkVersion::V2) {
28698 __tmp.put_i32_le(self.lat_int);
28699 __tmp.put_i32_le(self.lon_int);
28700 let len = __tmp.len();
28701 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28702 } else {
28703 __tmp.len()
28704 }
28705 }
28706}
28707#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28708#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28709#[doc = ""]
28710#[doc = "ID: 370"]
28711#[derive(Debug, Clone, PartialEq)]
28712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28714#[cfg_attr(feature = "ts", derive(TS))]
28715#[cfg_attr(feature = "ts", ts(export))]
28716pub struct SMART_BATTERY_INFO_DATA {
28717 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28718 pub capacity_full_specification: i32,
28719 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28720 pub capacity_full: i32,
28721 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28722 pub cycle_count: u16,
28723 #[doc = "Battery weight. 0: field not provided."]
28724 pub weight: u16,
28725 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28726 pub discharge_minimum_voltage: u16,
28727 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28728 pub charging_minimum_voltage: u16,
28729 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28730 pub resting_minimum_voltage: u16,
28731 #[doc = "Battery ID"]
28732 pub id: u8,
28733 #[doc = "Function of the battery"]
28734 pub battery_function: MavBatteryFunction,
28735 #[doc = "Type (chemistry) of the battery"]
28736 pub mavtype: MavBatteryType,
28737 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28738 #[cfg_attr(feature = "ts", ts(type = "string"))]
28739 pub serial_number: CharArray<16>,
28740 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28741 #[cfg_attr(feature = "ts", ts(type = "string"))]
28742 pub device_name: CharArray<50>,
28743 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28744 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28745 pub charging_maximum_voltage: u16,
28746 #[doc = "Number of battery cells in series. 0: field not provided."]
28747 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28748 pub cells_in_series: u8,
28749 #[doc = "Maximum pack discharge current. 0: field not provided."]
28750 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28751 pub discharge_maximum_current: u32,
28752 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28753 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28754 pub discharge_maximum_burst_current: u32,
28755 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28756 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28757 #[cfg_attr(feature = "ts", ts(type = "string"))]
28758 pub manufacture_date: CharArray<11>,
28759}
28760impl SMART_BATTERY_INFO_DATA {
28761 pub const ENCODED_LEN: usize = 109usize;
28762 pub const DEFAULT: Self = Self {
28763 capacity_full_specification: 0_i32,
28764 capacity_full: 0_i32,
28765 cycle_count: 0_u16,
28766 weight: 0_u16,
28767 discharge_minimum_voltage: 0_u16,
28768 charging_minimum_voltage: 0_u16,
28769 resting_minimum_voltage: 0_u16,
28770 id: 0_u8,
28771 battery_function: MavBatteryFunction::DEFAULT,
28772 mavtype: MavBatteryType::DEFAULT,
28773 serial_number: CharArray::new([0_u8; 16usize]),
28774 device_name: CharArray::new([0_u8; 50usize]),
28775 charging_maximum_voltage: 0_u16,
28776 cells_in_series: 0_u8,
28777 discharge_maximum_current: 0_u32,
28778 discharge_maximum_burst_current: 0_u32,
28779 manufacture_date: CharArray::new([0_u8; 11usize]),
28780 };
28781 #[cfg(feature = "arbitrary")]
28782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28783 use arbitrary::{Arbitrary, Unstructured};
28784 let mut buf = [0u8; 1024];
28785 rng.fill_bytes(&mut buf);
28786 let mut unstructured = Unstructured::new(&buf);
28787 Self::arbitrary(&mut unstructured).unwrap_or_default()
28788 }
28789}
28790impl Default for SMART_BATTERY_INFO_DATA {
28791 fn default() -> Self {
28792 Self::DEFAULT.clone()
28793 }
28794}
28795impl MessageData for SMART_BATTERY_INFO_DATA {
28796 type Message = MavMessage;
28797 const ID: u32 = 370u32;
28798 const NAME: &'static str = "SMART_BATTERY_INFO";
28799 const EXTRA_CRC: u8 = 75u8;
28800 const ENCODED_LEN: usize = 109usize;
28801 fn deser(
28802 _version: MavlinkVersion,
28803 __input: &[u8],
28804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28805 let avail_len = __input.len();
28806 let mut payload_buf = [0; Self::ENCODED_LEN];
28807 let mut buf = if avail_len < Self::ENCODED_LEN {
28808 payload_buf[0..avail_len].copy_from_slice(__input);
28809 Bytes::new(&payload_buf)
28810 } else {
28811 Bytes::new(__input)
28812 };
28813 let mut __struct = Self::default();
28814 __struct.capacity_full_specification = buf.get_i32_le()?;
28815 __struct.capacity_full = buf.get_i32_le()?;
28816 __struct.cycle_count = buf.get_u16_le()?;
28817 __struct.weight = buf.get_u16_le()?;
28818 __struct.discharge_minimum_voltage = buf.get_u16_le()?;
28819 __struct.charging_minimum_voltage = buf.get_u16_le()?;
28820 __struct.resting_minimum_voltage = buf.get_u16_le()?;
28821 __struct.id = buf.get_u8()?;
28822 let tmp = buf.get_u8()?;
28823 __struct.battery_function =
28824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28825 enum_type: "MavBatteryFunction",
28826 value: tmp as u64,
28827 })?;
28828 let tmp = buf.get_u8()?;
28829 __struct.mavtype =
28830 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28831 enum_type: "MavBatteryType",
28832 value: tmp as u64,
28833 })?;
28834 let mut tmp = [0_u8; 16usize];
28835 for v in &mut tmp {
28836 *v = buf.get_u8()?;
28837 }
28838 __struct.serial_number = CharArray::new(tmp);
28839 let mut tmp = [0_u8; 50usize];
28840 for v in &mut tmp {
28841 *v = buf.get_u8()?;
28842 }
28843 __struct.device_name = CharArray::new(tmp);
28844 __struct.charging_maximum_voltage = buf.get_u16_le()?;
28845 __struct.cells_in_series = buf.get_u8()?;
28846 __struct.discharge_maximum_current = buf.get_u32_le()?;
28847 __struct.discharge_maximum_burst_current = buf.get_u32_le()?;
28848 let mut tmp = [0_u8; 11usize];
28849 for v in &mut tmp {
28850 *v = buf.get_u8()?;
28851 }
28852 __struct.manufacture_date = CharArray::new(tmp);
28853 Ok(__struct)
28854 }
28855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28856 let mut __tmp = BytesMut::new(bytes);
28857 #[allow(clippy::absurd_extreme_comparisons)]
28858 #[allow(unused_comparisons)]
28859 if __tmp.remaining() < Self::ENCODED_LEN {
28860 panic!(
28861 "buffer is too small (need {} bytes, but got {})",
28862 Self::ENCODED_LEN,
28863 __tmp.remaining(),
28864 )
28865 }
28866 __tmp.put_i32_le(self.capacity_full_specification);
28867 __tmp.put_i32_le(self.capacity_full);
28868 __tmp.put_u16_le(self.cycle_count);
28869 __tmp.put_u16_le(self.weight);
28870 __tmp.put_u16_le(self.discharge_minimum_voltage);
28871 __tmp.put_u16_le(self.charging_minimum_voltage);
28872 __tmp.put_u16_le(self.resting_minimum_voltage);
28873 __tmp.put_u8(self.id);
28874 __tmp.put_u8(self.battery_function as u8);
28875 __tmp.put_u8(self.mavtype as u8);
28876 for val in &self.serial_number {
28877 __tmp.put_u8(*val);
28878 }
28879 for val in &self.device_name {
28880 __tmp.put_u8(*val);
28881 }
28882 if matches!(version, MavlinkVersion::V2) {
28883 __tmp.put_u16_le(self.charging_maximum_voltage);
28884 __tmp.put_u8(self.cells_in_series);
28885 __tmp.put_u32_le(self.discharge_maximum_current);
28886 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28887 for val in &self.manufacture_date {
28888 __tmp.put_u8(*val);
28889 }
28890 let len = __tmp.len();
28891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28892 } else {
28893 __tmp.len()
28894 }
28895 }
28896}
28897#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28898#[doc = ""]
28899#[doc = "ID: 253"]
28900#[derive(Debug, Clone, PartialEq)]
28901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28903#[cfg_attr(feature = "ts", derive(TS))]
28904#[cfg_attr(feature = "ts", ts(export))]
28905pub struct STATUSTEXT_DATA {
28906 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28907 pub severity: MavSeverity,
28908 #[doc = "Status text message, without null termination character"]
28909 #[cfg_attr(feature = "ts", ts(type = "string"))]
28910 pub text: CharArray<50>,
28911 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28912 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28913 pub id: u16,
28914 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28915 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28916 pub chunk_seq: u8,
28917}
28918impl STATUSTEXT_DATA {
28919 pub const ENCODED_LEN: usize = 54usize;
28920 pub const DEFAULT: Self = Self {
28921 severity: MavSeverity::DEFAULT,
28922 text: CharArray::new([0_u8; 50usize]),
28923 id: 0_u16,
28924 chunk_seq: 0_u8,
28925 };
28926 #[cfg(feature = "arbitrary")]
28927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28928 use arbitrary::{Arbitrary, Unstructured};
28929 let mut buf = [0u8; 1024];
28930 rng.fill_bytes(&mut buf);
28931 let mut unstructured = Unstructured::new(&buf);
28932 Self::arbitrary(&mut unstructured).unwrap_or_default()
28933 }
28934}
28935impl Default for STATUSTEXT_DATA {
28936 fn default() -> Self {
28937 Self::DEFAULT.clone()
28938 }
28939}
28940impl MessageData for STATUSTEXT_DATA {
28941 type Message = MavMessage;
28942 const ID: u32 = 253u32;
28943 const NAME: &'static str = "STATUSTEXT";
28944 const EXTRA_CRC: u8 = 83u8;
28945 const ENCODED_LEN: usize = 54usize;
28946 fn deser(
28947 _version: MavlinkVersion,
28948 __input: &[u8],
28949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28950 let avail_len = __input.len();
28951 let mut payload_buf = [0; Self::ENCODED_LEN];
28952 let mut buf = if avail_len < Self::ENCODED_LEN {
28953 payload_buf[0..avail_len].copy_from_slice(__input);
28954 Bytes::new(&payload_buf)
28955 } else {
28956 Bytes::new(__input)
28957 };
28958 let mut __struct = Self::default();
28959 let tmp = buf.get_u8()?;
28960 __struct.severity =
28961 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28962 enum_type: "MavSeverity",
28963 value: tmp as u64,
28964 })?;
28965 let mut tmp = [0_u8; 50usize];
28966 for v in &mut tmp {
28967 *v = buf.get_u8()?;
28968 }
28969 __struct.text = CharArray::new(tmp);
28970 __struct.id = buf.get_u16_le()?;
28971 __struct.chunk_seq = buf.get_u8()?;
28972 Ok(__struct)
28973 }
28974 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28975 let mut __tmp = BytesMut::new(bytes);
28976 #[allow(clippy::absurd_extreme_comparisons)]
28977 #[allow(unused_comparisons)]
28978 if __tmp.remaining() < Self::ENCODED_LEN {
28979 panic!(
28980 "buffer is too small (need {} bytes, but got {})",
28981 Self::ENCODED_LEN,
28982 __tmp.remaining(),
28983 )
28984 }
28985 __tmp.put_u8(self.severity as u8);
28986 for val in &self.text {
28987 __tmp.put_u8(*val);
28988 }
28989 if matches!(version, MavlinkVersion::V2) {
28990 __tmp.put_u16_le(self.id);
28991 __tmp.put_u8(self.chunk_seq);
28992 let len = __tmp.len();
28993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28994 } else {
28995 __tmp.len()
28996 }
28997 }
28998}
28999#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29000#[doc = ""]
29001#[doc = "ID: 261"]
29002#[derive(Debug, Clone, PartialEq)]
29003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29005#[cfg_attr(feature = "ts", derive(TS))]
29006#[cfg_attr(feature = "ts", ts(export))]
29007pub struct STORAGE_INFORMATION_DATA {
29008 #[doc = "Timestamp (time since system boot)."]
29009 pub time_boot_ms: u32,
29010 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29011 pub total_capacity: f32,
29012 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29013 pub used_capacity: f32,
29014 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29015 pub available_capacity: f32,
29016 #[doc = "Read speed."]
29017 pub read_speed: f32,
29018 #[doc = "Write speed."]
29019 pub write_speed: f32,
29020 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29021 pub storage_id: u8,
29022 #[doc = "Number of storage devices"]
29023 pub storage_count: u8,
29024 #[doc = "Status of storage"]
29025 pub status: StorageStatus,
29026 #[doc = "Type of storage"]
29027 #[cfg_attr(feature = "serde", serde(default))]
29028 pub mavtype: StorageType,
29029 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29030 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29031 #[cfg_attr(feature = "ts", ts(type = "string"))]
29032 pub name: CharArray<32>,
29033 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29034 #[cfg_attr(feature = "serde", serde(default))]
29035 pub storage_usage: StorageUsageFlag,
29036}
29037impl STORAGE_INFORMATION_DATA {
29038 pub const ENCODED_LEN: usize = 61usize;
29039 pub const DEFAULT: Self = Self {
29040 time_boot_ms: 0_u32,
29041 total_capacity: 0.0_f32,
29042 used_capacity: 0.0_f32,
29043 available_capacity: 0.0_f32,
29044 read_speed: 0.0_f32,
29045 write_speed: 0.0_f32,
29046 storage_id: 0_u8,
29047 storage_count: 0_u8,
29048 status: StorageStatus::DEFAULT,
29049 mavtype: StorageType::DEFAULT,
29050 name: CharArray::new([0_u8; 32usize]),
29051 storage_usage: StorageUsageFlag::DEFAULT,
29052 };
29053 #[cfg(feature = "arbitrary")]
29054 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29055 use arbitrary::{Arbitrary, Unstructured};
29056 let mut buf = [0u8; 1024];
29057 rng.fill_bytes(&mut buf);
29058 let mut unstructured = Unstructured::new(&buf);
29059 Self::arbitrary(&mut unstructured).unwrap_or_default()
29060 }
29061}
29062impl Default for STORAGE_INFORMATION_DATA {
29063 fn default() -> Self {
29064 Self::DEFAULT.clone()
29065 }
29066}
29067impl MessageData for STORAGE_INFORMATION_DATA {
29068 type Message = MavMessage;
29069 const ID: u32 = 261u32;
29070 const NAME: &'static str = "STORAGE_INFORMATION";
29071 const EXTRA_CRC: u8 = 179u8;
29072 const ENCODED_LEN: usize = 61usize;
29073 fn deser(
29074 _version: MavlinkVersion,
29075 __input: &[u8],
29076 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29077 let avail_len = __input.len();
29078 let mut payload_buf = [0; Self::ENCODED_LEN];
29079 let mut buf = if avail_len < Self::ENCODED_LEN {
29080 payload_buf[0..avail_len].copy_from_slice(__input);
29081 Bytes::new(&payload_buf)
29082 } else {
29083 Bytes::new(__input)
29084 };
29085 let mut __struct = Self::default();
29086 __struct.time_boot_ms = buf.get_u32_le()?;
29087 __struct.total_capacity = buf.get_f32_le()?;
29088 __struct.used_capacity = buf.get_f32_le()?;
29089 __struct.available_capacity = buf.get_f32_le()?;
29090 __struct.read_speed = buf.get_f32_le()?;
29091 __struct.write_speed = buf.get_f32_le()?;
29092 __struct.storage_id = buf.get_u8()?;
29093 __struct.storage_count = buf.get_u8()?;
29094 let tmp = buf.get_u8()?;
29095 __struct.status =
29096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29097 enum_type: "StorageStatus",
29098 value: tmp as u64,
29099 })?;
29100 let tmp = buf.get_u8()?;
29101 __struct.mavtype =
29102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29103 enum_type: "StorageType",
29104 value: tmp as u64,
29105 })?;
29106 let mut tmp = [0_u8; 32usize];
29107 for v in &mut tmp {
29108 *v = buf.get_u8()?;
29109 }
29110 __struct.name = CharArray::new(tmp);
29111 let tmp = buf.get_u8()?;
29112 __struct.storage_usage = StorageUsageFlag::from_bits(
29113 tmp as <StorageUsageFlag as Flags>::Bits,
29114 )
29115 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29116 flag_type: "StorageUsageFlag",
29117 value: tmp as u64,
29118 })?;
29119 Ok(__struct)
29120 }
29121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29122 let mut __tmp = BytesMut::new(bytes);
29123 #[allow(clippy::absurd_extreme_comparisons)]
29124 #[allow(unused_comparisons)]
29125 if __tmp.remaining() < Self::ENCODED_LEN {
29126 panic!(
29127 "buffer is too small (need {} bytes, but got {})",
29128 Self::ENCODED_LEN,
29129 __tmp.remaining(),
29130 )
29131 }
29132 __tmp.put_u32_le(self.time_boot_ms);
29133 __tmp.put_f32_le(self.total_capacity);
29134 __tmp.put_f32_le(self.used_capacity);
29135 __tmp.put_f32_le(self.available_capacity);
29136 __tmp.put_f32_le(self.read_speed);
29137 __tmp.put_f32_le(self.write_speed);
29138 __tmp.put_u8(self.storage_id);
29139 __tmp.put_u8(self.storage_count);
29140 __tmp.put_u8(self.status as u8);
29141 if matches!(version, MavlinkVersion::V2) {
29142 __tmp.put_u8(self.mavtype as u8);
29143 for val in &self.name {
29144 __tmp.put_u8(*val);
29145 }
29146 __tmp.put_u8(self.storage_usage.bits() as u8);
29147 let len = __tmp.len();
29148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29149 } else {
29150 __tmp.len()
29151 }
29152 }
29153}
29154#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29155#[doc = ""]
29156#[doc = "ID: 401"]
29157#[derive(Debug, Clone, PartialEq)]
29158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29160#[cfg_attr(feature = "ts", derive(TS))]
29161#[cfg_attr(feature = "ts", ts(export))]
29162pub struct SUPPORTED_TUNES_DATA {
29163 #[doc = "Bitfield of supported tune formats."]
29164 pub format: TuneFormat,
29165 #[doc = "System ID"]
29166 pub target_system: u8,
29167 #[doc = "Component ID"]
29168 pub target_component: u8,
29169}
29170impl SUPPORTED_TUNES_DATA {
29171 pub const ENCODED_LEN: usize = 6usize;
29172 pub const DEFAULT: Self = Self {
29173 format: TuneFormat::DEFAULT,
29174 target_system: 0_u8,
29175 target_component: 0_u8,
29176 };
29177 #[cfg(feature = "arbitrary")]
29178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29179 use arbitrary::{Arbitrary, Unstructured};
29180 let mut buf = [0u8; 1024];
29181 rng.fill_bytes(&mut buf);
29182 let mut unstructured = Unstructured::new(&buf);
29183 Self::arbitrary(&mut unstructured).unwrap_or_default()
29184 }
29185}
29186impl Default for SUPPORTED_TUNES_DATA {
29187 fn default() -> Self {
29188 Self::DEFAULT.clone()
29189 }
29190}
29191impl MessageData for SUPPORTED_TUNES_DATA {
29192 type Message = MavMessage;
29193 const ID: u32 = 401u32;
29194 const NAME: &'static str = "SUPPORTED_TUNES";
29195 const EXTRA_CRC: u8 = 183u8;
29196 const ENCODED_LEN: usize = 6usize;
29197 fn deser(
29198 _version: MavlinkVersion,
29199 __input: &[u8],
29200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29201 let avail_len = __input.len();
29202 let mut payload_buf = [0; Self::ENCODED_LEN];
29203 let mut buf = if avail_len < Self::ENCODED_LEN {
29204 payload_buf[0..avail_len].copy_from_slice(__input);
29205 Bytes::new(&payload_buf)
29206 } else {
29207 Bytes::new(__input)
29208 };
29209 let mut __struct = Self::default();
29210 let tmp = buf.get_u32_le()?;
29211 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29212 ::mavlink_core::error::ParserError::InvalidEnum {
29213 enum_type: "TuneFormat",
29214 value: tmp as u64,
29215 },
29216 )?;
29217 __struct.target_system = buf.get_u8()?;
29218 __struct.target_component = buf.get_u8()?;
29219 Ok(__struct)
29220 }
29221 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29222 let mut __tmp = BytesMut::new(bytes);
29223 #[allow(clippy::absurd_extreme_comparisons)]
29224 #[allow(unused_comparisons)]
29225 if __tmp.remaining() < Self::ENCODED_LEN {
29226 panic!(
29227 "buffer is too small (need {} bytes, but got {})",
29228 Self::ENCODED_LEN,
29229 __tmp.remaining(),
29230 )
29231 }
29232 __tmp.put_u32_le(self.format as u32);
29233 __tmp.put_u8(self.target_system);
29234 __tmp.put_u8(self.target_component);
29235 if matches!(version, MavlinkVersion::V2) {
29236 let len = __tmp.len();
29237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29238 } else {
29239 __tmp.len()
29240 }
29241 }
29242}
29243#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29244#[doc = ""]
29245#[doc = "ID: 2"]
29246#[derive(Debug, Clone, PartialEq)]
29247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29249#[cfg_attr(feature = "ts", derive(TS))]
29250#[cfg_attr(feature = "ts", ts(export))]
29251pub struct SYSTEM_TIME_DATA {
29252 #[doc = "Timestamp (UNIX epoch time)."]
29253 pub time_unix_usec: u64,
29254 #[doc = "Timestamp (time since system boot)."]
29255 pub time_boot_ms: u32,
29256}
29257impl SYSTEM_TIME_DATA {
29258 pub const ENCODED_LEN: usize = 12usize;
29259 pub const DEFAULT: Self = Self {
29260 time_unix_usec: 0_u64,
29261 time_boot_ms: 0_u32,
29262 };
29263 #[cfg(feature = "arbitrary")]
29264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29265 use arbitrary::{Arbitrary, Unstructured};
29266 let mut buf = [0u8; 1024];
29267 rng.fill_bytes(&mut buf);
29268 let mut unstructured = Unstructured::new(&buf);
29269 Self::arbitrary(&mut unstructured).unwrap_or_default()
29270 }
29271}
29272impl Default for SYSTEM_TIME_DATA {
29273 fn default() -> Self {
29274 Self::DEFAULT.clone()
29275 }
29276}
29277impl MessageData for SYSTEM_TIME_DATA {
29278 type Message = MavMessage;
29279 const ID: u32 = 2u32;
29280 const NAME: &'static str = "SYSTEM_TIME";
29281 const EXTRA_CRC: u8 = 137u8;
29282 const ENCODED_LEN: usize = 12usize;
29283 fn deser(
29284 _version: MavlinkVersion,
29285 __input: &[u8],
29286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29287 let avail_len = __input.len();
29288 let mut payload_buf = [0; Self::ENCODED_LEN];
29289 let mut buf = if avail_len < Self::ENCODED_LEN {
29290 payload_buf[0..avail_len].copy_from_slice(__input);
29291 Bytes::new(&payload_buf)
29292 } else {
29293 Bytes::new(__input)
29294 };
29295 let mut __struct = Self::default();
29296 __struct.time_unix_usec = buf.get_u64_le()?;
29297 __struct.time_boot_ms = buf.get_u32_le()?;
29298 Ok(__struct)
29299 }
29300 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29301 let mut __tmp = BytesMut::new(bytes);
29302 #[allow(clippy::absurd_extreme_comparisons)]
29303 #[allow(unused_comparisons)]
29304 if __tmp.remaining() < Self::ENCODED_LEN {
29305 panic!(
29306 "buffer is too small (need {} bytes, but got {})",
29307 Self::ENCODED_LEN,
29308 __tmp.remaining(),
29309 )
29310 }
29311 __tmp.put_u64_le(self.time_unix_usec);
29312 __tmp.put_u32_le(self.time_boot_ms);
29313 if matches!(version, MavlinkVersion::V2) {
29314 let len = __tmp.len();
29315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29316 } else {
29317 __tmp.len()
29318 }
29319 }
29320}
29321#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29322#[doc = ""]
29323#[doc = "ID: 1"]
29324#[derive(Debug, Clone, PartialEq)]
29325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29327#[cfg_attr(feature = "ts", derive(TS))]
29328#[cfg_attr(feature = "ts", ts(export))]
29329pub struct SYS_STATUS_DATA {
29330 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29331 pub onboard_control_sensors_present: MavSysStatusSensor,
29332 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29333 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29334 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29335 pub onboard_control_sensors_health: MavSysStatusSensor,
29336 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29337 pub load: u16,
29338 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29339 pub voltage_battery: u16,
29340 #[doc = "Battery current, -1: Current not sent by autopilot"]
29341 pub current_battery: i16,
29342 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29343 pub drop_rate_comm: u16,
29344 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29345 pub errors_comm: u16,
29346 #[doc = "Autopilot-specific errors"]
29347 pub errors_count1: u16,
29348 #[doc = "Autopilot-specific errors"]
29349 pub errors_count2: u16,
29350 #[doc = "Autopilot-specific errors"]
29351 pub errors_count3: u16,
29352 #[doc = "Autopilot-specific errors"]
29353 pub errors_count4: u16,
29354 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29355 pub battery_remaining: i8,
29356 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29357 #[cfg_attr(feature = "serde", serde(default))]
29358 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29359 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29360 #[cfg_attr(feature = "serde", serde(default))]
29361 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29362 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29363 #[cfg_attr(feature = "serde", serde(default))]
29364 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29365}
29366impl SYS_STATUS_DATA {
29367 pub const ENCODED_LEN: usize = 43usize;
29368 pub const DEFAULT: Self = Self {
29369 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29370 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29371 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29372 load: 0_u16,
29373 voltage_battery: 0_u16,
29374 current_battery: 0_i16,
29375 drop_rate_comm: 0_u16,
29376 errors_comm: 0_u16,
29377 errors_count1: 0_u16,
29378 errors_count2: 0_u16,
29379 errors_count3: 0_u16,
29380 errors_count4: 0_u16,
29381 battery_remaining: 0_i8,
29382 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29383 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29384 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29385 };
29386 #[cfg(feature = "arbitrary")]
29387 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29388 use arbitrary::{Arbitrary, Unstructured};
29389 let mut buf = [0u8; 1024];
29390 rng.fill_bytes(&mut buf);
29391 let mut unstructured = Unstructured::new(&buf);
29392 Self::arbitrary(&mut unstructured).unwrap_or_default()
29393 }
29394}
29395impl Default for SYS_STATUS_DATA {
29396 fn default() -> Self {
29397 Self::DEFAULT.clone()
29398 }
29399}
29400impl MessageData for SYS_STATUS_DATA {
29401 type Message = MavMessage;
29402 const ID: u32 = 1u32;
29403 const NAME: &'static str = "SYS_STATUS";
29404 const EXTRA_CRC: u8 = 124u8;
29405 const ENCODED_LEN: usize = 43usize;
29406 fn deser(
29407 _version: MavlinkVersion,
29408 __input: &[u8],
29409 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29410 let avail_len = __input.len();
29411 let mut payload_buf = [0; Self::ENCODED_LEN];
29412 let mut buf = if avail_len < Self::ENCODED_LEN {
29413 payload_buf[0..avail_len].copy_from_slice(__input);
29414 Bytes::new(&payload_buf)
29415 } else {
29416 Bytes::new(__input)
29417 };
29418 let mut __struct = Self::default();
29419 let tmp = buf.get_u32_le()?;
29420 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29421 tmp as <MavSysStatusSensor as Flags>::Bits,
29422 )
29423 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29424 flag_type: "MavSysStatusSensor",
29425 value: tmp as u64,
29426 })?;
29427 let tmp = buf.get_u32_le()?;
29428 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29429 tmp as <MavSysStatusSensor as Flags>::Bits,
29430 )
29431 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29432 flag_type: "MavSysStatusSensor",
29433 value: tmp as u64,
29434 })?;
29435 let tmp = buf.get_u32_le()?;
29436 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29437 tmp as <MavSysStatusSensor as Flags>::Bits,
29438 )
29439 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29440 flag_type: "MavSysStatusSensor",
29441 value: tmp as u64,
29442 })?;
29443 __struct.load = buf.get_u16_le()?;
29444 __struct.voltage_battery = buf.get_u16_le()?;
29445 __struct.current_battery = buf.get_i16_le()?;
29446 __struct.drop_rate_comm = buf.get_u16_le()?;
29447 __struct.errors_comm = buf.get_u16_le()?;
29448 __struct.errors_count1 = buf.get_u16_le()?;
29449 __struct.errors_count2 = buf.get_u16_le()?;
29450 __struct.errors_count3 = buf.get_u16_le()?;
29451 __struct.errors_count4 = buf.get_u16_le()?;
29452 __struct.battery_remaining = buf.get_i8()?;
29453 let tmp = buf.get_u32_le()?;
29454 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
29455 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29456 )
29457 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29458 flag_type: "MavSysStatusSensorExtended",
29459 value: tmp as u64,
29460 })?;
29461 let tmp = buf.get_u32_le()?;
29462 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
29463 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29464 )
29465 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29466 flag_type: "MavSysStatusSensorExtended",
29467 value: tmp as u64,
29468 })?;
29469 let tmp = buf.get_u32_le()?;
29470 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
29471 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
29472 )
29473 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29474 flag_type: "MavSysStatusSensorExtended",
29475 value: tmp as u64,
29476 })?;
29477 Ok(__struct)
29478 }
29479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29480 let mut __tmp = BytesMut::new(bytes);
29481 #[allow(clippy::absurd_extreme_comparisons)]
29482 #[allow(unused_comparisons)]
29483 if __tmp.remaining() < Self::ENCODED_LEN {
29484 panic!(
29485 "buffer is too small (need {} bytes, but got {})",
29486 Self::ENCODED_LEN,
29487 __tmp.remaining(),
29488 )
29489 }
29490 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
29491 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
29492 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
29493 __tmp.put_u16_le(self.load);
29494 __tmp.put_u16_le(self.voltage_battery);
29495 __tmp.put_i16_le(self.current_battery);
29496 __tmp.put_u16_le(self.drop_rate_comm);
29497 __tmp.put_u16_le(self.errors_comm);
29498 __tmp.put_u16_le(self.errors_count1);
29499 __tmp.put_u16_le(self.errors_count2);
29500 __tmp.put_u16_le(self.errors_count3);
29501 __tmp.put_u16_le(self.errors_count4);
29502 __tmp.put_i8(self.battery_remaining);
29503 if matches!(version, MavlinkVersion::V2) {
29504 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
29505 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
29506 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
29507 let len = __tmp.len();
29508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29509 } else {
29510 __tmp.len()
29511 }
29512 }
29513}
29514#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29515#[doc = ""]
29516#[doc = "ID: 135"]
29517#[derive(Debug, Clone, PartialEq)]
29518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29520#[cfg_attr(feature = "ts", derive(TS))]
29521#[cfg_attr(feature = "ts", ts(export))]
29522pub struct TERRAIN_CHECK_DATA {
29523 #[doc = "Latitude"]
29524 pub lat: i32,
29525 #[doc = "Longitude"]
29526 pub lon: i32,
29527}
29528impl TERRAIN_CHECK_DATA {
29529 pub const ENCODED_LEN: usize = 8usize;
29530 pub const DEFAULT: Self = Self {
29531 lat: 0_i32,
29532 lon: 0_i32,
29533 };
29534 #[cfg(feature = "arbitrary")]
29535 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29536 use arbitrary::{Arbitrary, Unstructured};
29537 let mut buf = [0u8; 1024];
29538 rng.fill_bytes(&mut buf);
29539 let mut unstructured = Unstructured::new(&buf);
29540 Self::arbitrary(&mut unstructured).unwrap_or_default()
29541 }
29542}
29543impl Default for TERRAIN_CHECK_DATA {
29544 fn default() -> Self {
29545 Self::DEFAULT.clone()
29546 }
29547}
29548impl MessageData for TERRAIN_CHECK_DATA {
29549 type Message = MavMessage;
29550 const ID: u32 = 135u32;
29551 const NAME: &'static str = "TERRAIN_CHECK";
29552 const EXTRA_CRC: u8 = 203u8;
29553 const ENCODED_LEN: usize = 8usize;
29554 fn deser(
29555 _version: MavlinkVersion,
29556 __input: &[u8],
29557 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29558 let avail_len = __input.len();
29559 let mut payload_buf = [0; Self::ENCODED_LEN];
29560 let mut buf = if avail_len < Self::ENCODED_LEN {
29561 payload_buf[0..avail_len].copy_from_slice(__input);
29562 Bytes::new(&payload_buf)
29563 } else {
29564 Bytes::new(__input)
29565 };
29566 let mut __struct = Self::default();
29567 __struct.lat = buf.get_i32_le()?;
29568 __struct.lon = buf.get_i32_le()?;
29569 Ok(__struct)
29570 }
29571 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29572 let mut __tmp = BytesMut::new(bytes);
29573 #[allow(clippy::absurd_extreme_comparisons)]
29574 #[allow(unused_comparisons)]
29575 if __tmp.remaining() < Self::ENCODED_LEN {
29576 panic!(
29577 "buffer is too small (need {} bytes, but got {})",
29578 Self::ENCODED_LEN,
29579 __tmp.remaining(),
29580 )
29581 }
29582 __tmp.put_i32_le(self.lat);
29583 __tmp.put_i32_le(self.lon);
29584 if matches!(version, MavlinkVersion::V2) {
29585 let len = __tmp.len();
29586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29587 } else {
29588 __tmp.len()
29589 }
29590 }
29591}
29592#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29593#[doc = ""]
29594#[doc = "ID: 134"]
29595#[derive(Debug, Clone, PartialEq)]
29596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29598#[cfg_attr(feature = "ts", derive(TS))]
29599#[cfg_attr(feature = "ts", ts(export))]
29600pub struct TERRAIN_DATA_DATA {
29601 #[doc = "Latitude of SW corner of first grid"]
29602 pub lat: i32,
29603 #[doc = "Longitude of SW corner of first grid"]
29604 pub lon: i32,
29605 #[doc = "Grid spacing"]
29606 pub grid_spacing: u16,
29607 #[doc = "Terrain data MSL"]
29608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29609 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29610 pub data: [i16; 16],
29611 #[doc = "bit within the terrain request mask"]
29612 pub gridbit: u8,
29613}
29614impl TERRAIN_DATA_DATA {
29615 pub const ENCODED_LEN: usize = 43usize;
29616 pub const DEFAULT: Self = Self {
29617 lat: 0_i32,
29618 lon: 0_i32,
29619 grid_spacing: 0_u16,
29620 data: [0_i16; 16usize],
29621 gridbit: 0_u8,
29622 };
29623 #[cfg(feature = "arbitrary")]
29624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29625 use arbitrary::{Arbitrary, Unstructured};
29626 let mut buf = [0u8; 1024];
29627 rng.fill_bytes(&mut buf);
29628 let mut unstructured = Unstructured::new(&buf);
29629 Self::arbitrary(&mut unstructured).unwrap_or_default()
29630 }
29631}
29632impl Default for TERRAIN_DATA_DATA {
29633 fn default() -> Self {
29634 Self::DEFAULT.clone()
29635 }
29636}
29637impl MessageData for TERRAIN_DATA_DATA {
29638 type Message = MavMessage;
29639 const ID: u32 = 134u32;
29640 const NAME: &'static str = "TERRAIN_DATA";
29641 const EXTRA_CRC: u8 = 229u8;
29642 const ENCODED_LEN: usize = 43usize;
29643 fn deser(
29644 _version: MavlinkVersion,
29645 __input: &[u8],
29646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29647 let avail_len = __input.len();
29648 let mut payload_buf = [0; Self::ENCODED_LEN];
29649 let mut buf = if avail_len < Self::ENCODED_LEN {
29650 payload_buf[0..avail_len].copy_from_slice(__input);
29651 Bytes::new(&payload_buf)
29652 } else {
29653 Bytes::new(__input)
29654 };
29655 let mut __struct = Self::default();
29656 __struct.lat = buf.get_i32_le()?;
29657 __struct.lon = buf.get_i32_le()?;
29658 __struct.grid_spacing = buf.get_u16_le()?;
29659 for v in &mut __struct.data {
29660 let val = buf.get_i16_le()?;
29661 *v = val;
29662 }
29663 __struct.gridbit = buf.get_u8()?;
29664 Ok(__struct)
29665 }
29666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29667 let mut __tmp = BytesMut::new(bytes);
29668 #[allow(clippy::absurd_extreme_comparisons)]
29669 #[allow(unused_comparisons)]
29670 if __tmp.remaining() < Self::ENCODED_LEN {
29671 panic!(
29672 "buffer is too small (need {} bytes, but got {})",
29673 Self::ENCODED_LEN,
29674 __tmp.remaining(),
29675 )
29676 }
29677 __tmp.put_i32_le(self.lat);
29678 __tmp.put_i32_le(self.lon);
29679 __tmp.put_u16_le(self.grid_spacing);
29680 for val in &self.data {
29681 __tmp.put_i16_le(*val);
29682 }
29683 __tmp.put_u8(self.gridbit);
29684 if matches!(version, MavlinkVersion::V2) {
29685 let len = __tmp.len();
29686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29687 } else {
29688 __tmp.len()
29689 }
29690 }
29691}
29692#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29693#[doc = ""]
29694#[doc = "ID: 136"]
29695#[derive(Debug, Clone, PartialEq)]
29696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29698#[cfg_attr(feature = "ts", derive(TS))]
29699#[cfg_attr(feature = "ts", ts(export))]
29700pub struct TERRAIN_REPORT_DATA {
29701 #[doc = "Latitude"]
29702 pub lat: i32,
29703 #[doc = "Longitude"]
29704 pub lon: i32,
29705 #[doc = "Terrain height MSL"]
29706 pub terrain_height: f32,
29707 #[doc = "Current vehicle height above lat/lon terrain height"]
29708 pub current_height: f32,
29709 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29710 pub spacing: u16,
29711 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29712 pub pending: u16,
29713 #[doc = "Number of 4x4 terrain blocks in memory"]
29714 pub loaded: u16,
29715}
29716impl TERRAIN_REPORT_DATA {
29717 pub const ENCODED_LEN: usize = 22usize;
29718 pub const DEFAULT: Self = Self {
29719 lat: 0_i32,
29720 lon: 0_i32,
29721 terrain_height: 0.0_f32,
29722 current_height: 0.0_f32,
29723 spacing: 0_u16,
29724 pending: 0_u16,
29725 loaded: 0_u16,
29726 };
29727 #[cfg(feature = "arbitrary")]
29728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29729 use arbitrary::{Arbitrary, Unstructured};
29730 let mut buf = [0u8; 1024];
29731 rng.fill_bytes(&mut buf);
29732 let mut unstructured = Unstructured::new(&buf);
29733 Self::arbitrary(&mut unstructured).unwrap_or_default()
29734 }
29735}
29736impl Default for TERRAIN_REPORT_DATA {
29737 fn default() -> Self {
29738 Self::DEFAULT.clone()
29739 }
29740}
29741impl MessageData for TERRAIN_REPORT_DATA {
29742 type Message = MavMessage;
29743 const ID: u32 = 136u32;
29744 const NAME: &'static str = "TERRAIN_REPORT";
29745 const EXTRA_CRC: u8 = 1u8;
29746 const ENCODED_LEN: usize = 22usize;
29747 fn deser(
29748 _version: MavlinkVersion,
29749 __input: &[u8],
29750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29751 let avail_len = __input.len();
29752 let mut payload_buf = [0; Self::ENCODED_LEN];
29753 let mut buf = if avail_len < Self::ENCODED_LEN {
29754 payload_buf[0..avail_len].copy_from_slice(__input);
29755 Bytes::new(&payload_buf)
29756 } else {
29757 Bytes::new(__input)
29758 };
29759 let mut __struct = Self::default();
29760 __struct.lat = buf.get_i32_le()?;
29761 __struct.lon = buf.get_i32_le()?;
29762 __struct.terrain_height = buf.get_f32_le()?;
29763 __struct.current_height = buf.get_f32_le()?;
29764 __struct.spacing = buf.get_u16_le()?;
29765 __struct.pending = buf.get_u16_le()?;
29766 __struct.loaded = buf.get_u16_le()?;
29767 Ok(__struct)
29768 }
29769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29770 let mut __tmp = BytesMut::new(bytes);
29771 #[allow(clippy::absurd_extreme_comparisons)]
29772 #[allow(unused_comparisons)]
29773 if __tmp.remaining() < Self::ENCODED_LEN {
29774 panic!(
29775 "buffer is too small (need {} bytes, but got {})",
29776 Self::ENCODED_LEN,
29777 __tmp.remaining(),
29778 )
29779 }
29780 __tmp.put_i32_le(self.lat);
29781 __tmp.put_i32_le(self.lon);
29782 __tmp.put_f32_le(self.terrain_height);
29783 __tmp.put_f32_le(self.current_height);
29784 __tmp.put_u16_le(self.spacing);
29785 __tmp.put_u16_le(self.pending);
29786 __tmp.put_u16_le(self.loaded);
29787 if matches!(version, MavlinkVersion::V2) {
29788 let len = __tmp.len();
29789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29790 } else {
29791 __tmp.len()
29792 }
29793 }
29794}
29795#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29796#[doc = ""]
29797#[doc = "ID: 133"]
29798#[derive(Debug, Clone, PartialEq)]
29799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29801#[cfg_attr(feature = "ts", derive(TS))]
29802#[cfg_attr(feature = "ts", ts(export))]
29803pub struct TERRAIN_REQUEST_DATA {
29804 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29805 pub mask: u64,
29806 #[doc = "Latitude of SW corner of first grid"]
29807 pub lat: i32,
29808 #[doc = "Longitude of SW corner of first grid"]
29809 pub lon: i32,
29810 #[doc = "Grid spacing"]
29811 pub grid_spacing: u16,
29812}
29813impl TERRAIN_REQUEST_DATA {
29814 pub const ENCODED_LEN: usize = 18usize;
29815 pub const DEFAULT: Self = Self {
29816 mask: 0_u64,
29817 lat: 0_i32,
29818 lon: 0_i32,
29819 grid_spacing: 0_u16,
29820 };
29821 #[cfg(feature = "arbitrary")]
29822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29823 use arbitrary::{Arbitrary, Unstructured};
29824 let mut buf = [0u8; 1024];
29825 rng.fill_bytes(&mut buf);
29826 let mut unstructured = Unstructured::new(&buf);
29827 Self::arbitrary(&mut unstructured).unwrap_or_default()
29828 }
29829}
29830impl Default for TERRAIN_REQUEST_DATA {
29831 fn default() -> Self {
29832 Self::DEFAULT.clone()
29833 }
29834}
29835impl MessageData for TERRAIN_REQUEST_DATA {
29836 type Message = MavMessage;
29837 const ID: u32 = 133u32;
29838 const NAME: &'static str = "TERRAIN_REQUEST";
29839 const EXTRA_CRC: u8 = 6u8;
29840 const ENCODED_LEN: usize = 18usize;
29841 fn deser(
29842 _version: MavlinkVersion,
29843 __input: &[u8],
29844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29845 let avail_len = __input.len();
29846 let mut payload_buf = [0; Self::ENCODED_LEN];
29847 let mut buf = if avail_len < Self::ENCODED_LEN {
29848 payload_buf[0..avail_len].copy_from_slice(__input);
29849 Bytes::new(&payload_buf)
29850 } else {
29851 Bytes::new(__input)
29852 };
29853 let mut __struct = Self::default();
29854 __struct.mask = buf.get_u64_le()?;
29855 __struct.lat = buf.get_i32_le()?;
29856 __struct.lon = buf.get_i32_le()?;
29857 __struct.grid_spacing = buf.get_u16_le()?;
29858 Ok(__struct)
29859 }
29860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29861 let mut __tmp = BytesMut::new(bytes);
29862 #[allow(clippy::absurd_extreme_comparisons)]
29863 #[allow(unused_comparisons)]
29864 if __tmp.remaining() < Self::ENCODED_LEN {
29865 panic!(
29866 "buffer is too small (need {} bytes, but got {})",
29867 Self::ENCODED_LEN,
29868 __tmp.remaining(),
29869 )
29870 }
29871 __tmp.put_u64_le(self.mask);
29872 __tmp.put_i32_le(self.lat);
29873 __tmp.put_i32_le(self.lon);
29874 __tmp.put_u16_le(self.grid_spacing);
29875 if matches!(version, MavlinkVersion::V2) {
29876 let len = __tmp.len();
29877 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29878 } else {
29879 __tmp.len()
29880 }
29881 }
29882}
29883#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29884#[doc = ""]
29885#[doc = "ID: 111"]
29886#[derive(Debug, Clone, PartialEq)]
29887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29888#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29889#[cfg_attr(feature = "ts", derive(TS))]
29890#[cfg_attr(feature = "ts", ts(export))]
29891pub struct TIMESYNC_DATA {
29892 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29893 pub tc1: i64,
29894 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29895 pub ts1: i64,
29896 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29897 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29898 pub target_system: u8,
29899 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29900 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29901 pub target_component: u8,
29902}
29903impl TIMESYNC_DATA {
29904 pub const ENCODED_LEN: usize = 18usize;
29905 pub const DEFAULT: Self = Self {
29906 tc1: 0_i64,
29907 ts1: 0_i64,
29908 target_system: 0_u8,
29909 target_component: 0_u8,
29910 };
29911 #[cfg(feature = "arbitrary")]
29912 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29913 use arbitrary::{Arbitrary, Unstructured};
29914 let mut buf = [0u8; 1024];
29915 rng.fill_bytes(&mut buf);
29916 let mut unstructured = Unstructured::new(&buf);
29917 Self::arbitrary(&mut unstructured).unwrap_or_default()
29918 }
29919}
29920impl Default for TIMESYNC_DATA {
29921 fn default() -> Self {
29922 Self::DEFAULT.clone()
29923 }
29924}
29925impl MessageData for TIMESYNC_DATA {
29926 type Message = MavMessage;
29927 const ID: u32 = 111u32;
29928 const NAME: &'static str = "TIMESYNC";
29929 const EXTRA_CRC: u8 = 34u8;
29930 const ENCODED_LEN: usize = 18usize;
29931 fn deser(
29932 _version: MavlinkVersion,
29933 __input: &[u8],
29934 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29935 let avail_len = __input.len();
29936 let mut payload_buf = [0; Self::ENCODED_LEN];
29937 let mut buf = if avail_len < Self::ENCODED_LEN {
29938 payload_buf[0..avail_len].copy_from_slice(__input);
29939 Bytes::new(&payload_buf)
29940 } else {
29941 Bytes::new(__input)
29942 };
29943 let mut __struct = Self::default();
29944 __struct.tc1 = buf.get_i64_le()?;
29945 __struct.ts1 = buf.get_i64_le()?;
29946 __struct.target_system = buf.get_u8()?;
29947 __struct.target_component = buf.get_u8()?;
29948 Ok(__struct)
29949 }
29950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29951 let mut __tmp = BytesMut::new(bytes);
29952 #[allow(clippy::absurd_extreme_comparisons)]
29953 #[allow(unused_comparisons)]
29954 if __tmp.remaining() < Self::ENCODED_LEN {
29955 panic!(
29956 "buffer is too small (need {} bytes, but got {})",
29957 Self::ENCODED_LEN,
29958 __tmp.remaining(),
29959 )
29960 }
29961 __tmp.put_i64_le(self.tc1);
29962 __tmp.put_i64_le(self.ts1);
29963 if matches!(version, MavlinkVersion::V2) {
29964 __tmp.put_u8(self.target_system);
29965 __tmp.put_u8(self.target_component);
29966 let len = __tmp.len();
29967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29968 } else {
29969 __tmp.len()
29970 }
29971 }
29972}
29973#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29974#[doc = ""]
29975#[doc = "ID: 380"]
29976#[derive(Debug, Clone, PartialEq)]
29977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29979#[cfg_attr(feature = "ts", derive(TS))]
29980#[cfg_attr(feature = "ts", ts(export))]
29981pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29982 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29983 pub safe_return: i32,
29984 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29985 pub land: i32,
29986 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29987 pub mission_next_item: i32,
29988 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29989 pub mission_end: i32,
29990 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29991 pub commanded_action: i32,
29992}
29993impl TIME_ESTIMATE_TO_TARGET_DATA {
29994 pub const ENCODED_LEN: usize = 20usize;
29995 pub const DEFAULT: Self = Self {
29996 safe_return: 0_i32,
29997 land: 0_i32,
29998 mission_next_item: 0_i32,
29999 mission_end: 0_i32,
30000 commanded_action: 0_i32,
30001 };
30002 #[cfg(feature = "arbitrary")]
30003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30004 use arbitrary::{Arbitrary, Unstructured};
30005 let mut buf = [0u8; 1024];
30006 rng.fill_bytes(&mut buf);
30007 let mut unstructured = Unstructured::new(&buf);
30008 Self::arbitrary(&mut unstructured).unwrap_or_default()
30009 }
30010}
30011impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30012 fn default() -> Self {
30013 Self::DEFAULT.clone()
30014 }
30015}
30016impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30017 type Message = MavMessage;
30018 const ID: u32 = 380u32;
30019 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30020 const EXTRA_CRC: u8 = 232u8;
30021 const ENCODED_LEN: usize = 20usize;
30022 fn deser(
30023 _version: MavlinkVersion,
30024 __input: &[u8],
30025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30026 let avail_len = __input.len();
30027 let mut payload_buf = [0; Self::ENCODED_LEN];
30028 let mut buf = if avail_len < Self::ENCODED_LEN {
30029 payload_buf[0..avail_len].copy_from_slice(__input);
30030 Bytes::new(&payload_buf)
30031 } else {
30032 Bytes::new(__input)
30033 };
30034 let mut __struct = Self::default();
30035 __struct.safe_return = buf.get_i32_le()?;
30036 __struct.land = buf.get_i32_le()?;
30037 __struct.mission_next_item = buf.get_i32_le()?;
30038 __struct.mission_end = buf.get_i32_le()?;
30039 __struct.commanded_action = buf.get_i32_le()?;
30040 Ok(__struct)
30041 }
30042 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30043 let mut __tmp = BytesMut::new(bytes);
30044 #[allow(clippy::absurd_extreme_comparisons)]
30045 #[allow(unused_comparisons)]
30046 if __tmp.remaining() < Self::ENCODED_LEN {
30047 panic!(
30048 "buffer is too small (need {} bytes, but got {})",
30049 Self::ENCODED_LEN,
30050 __tmp.remaining(),
30051 )
30052 }
30053 __tmp.put_i32_le(self.safe_return);
30054 __tmp.put_i32_le(self.land);
30055 __tmp.put_i32_le(self.mission_next_item);
30056 __tmp.put_i32_le(self.mission_end);
30057 __tmp.put_i32_le(self.commanded_action);
30058 if matches!(version, MavlinkVersion::V2) {
30059 let len = __tmp.len();
30060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30061 } else {
30062 __tmp.len()
30063 }
30064 }
30065}
30066#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30067#[doc = ""]
30068#[doc = "ID: 333"]
30069#[derive(Debug, Clone, PartialEq)]
30070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30072#[cfg_attr(feature = "ts", derive(TS))]
30073#[cfg_attr(feature = "ts", ts(export))]
30074pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30075 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30076 pub time_usec: u64,
30077 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30078 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30079 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30080 pub pos_x: [f32; 5],
30081 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30082 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30083 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30084 pub pos_y: [f32; 5],
30085 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30086 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30087 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30088 pub pos_z: [f32; 5],
30089 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30090 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30091 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30092 pub delta: [f32; 5],
30093 #[doc = "Yaw. Set to NaN for unchanged"]
30094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30095 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30096 pub pos_yaw: [f32; 5],
30097 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30098 pub valid_points: u8,
30099}
30100impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30101 pub const ENCODED_LEN: usize = 109usize;
30102 pub const DEFAULT: Self = Self {
30103 time_usec: 0_u64,
30104 pos_x: [0.0_f32; 5usize],
30105 pos_y: [0.0_f32; 5usize],
30106 pos_z: [0.0_f32; 5usize],
30107 delta: [0.0_f32; 5usize],
30108 pos_yaw: [0.0_f32; 5usize],
30109 valid_points: 0_u8,
30110 };
30111 #[cfg(feature = "arbitrary")]
30112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30113 use arbitrary::{Arbitrary, Unstructured};
30114 let mut buf = [0u8; 1024];
30115 rng.fill_bytes(&mut buf);
30116 let mut unstructured = Unstructured::new(&buf);
30117 Self::arbitrary(&mut unstructured).unwrap_or_default()
30118 }
30119}
30120impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30121 fn default() -> Self {
30122 Self::DEFAULT.clone()
30123 }
30124}
30125impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30126 type Message = MavMessage;
30127 const ID: u32 = 333u32;
30128 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30129 const EXTRA_CRC: u8 = 231u8;
30130 const ENCODED_LEN: usize = 109usize;
30131 fn deser(
30132 _version: MavlinkVersion,
30133 __input: &[u8],
30134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30135 let avail_len = __input.len();
30136 let mut payload_buf = [0; Self::ENCODED_LEN];
30137 let mut buf = if avail_len < Self::ENCODED_LEN {
30138 payload_buf[0..avail_len].copy_from_slice(__input);
30139 Bytes::new(&payload_buf)
30140 } else {
30141 Bytes::new(__input)
30142 };
30143 let mut __struct = Self::default();
30144 __struct.time_usec = buf.get_u64_le()?;
30145 for v in &mut __struct.pos_x {
30146 let val = buf.get_f32_le()?;
30147 *v = val;
30148 }
30149 for v in &mut __struct.pos_y {
30150 let val = buf.get_f32_le()?;
30151 *v = val;
30152 }
30153 for v in &mut __struct.pos_z {
30154 let val = buf.get_f32_le()?;
30155 *v = val;
30156 }
30157 for v in &mut __struct.delta {
30158 let val = buf.get_f32_le()?;
30159 *v = val;
30160 }
30161 for v in &mut __struct.pos_yaw {
30162 let val = buf.get_f32_le()?;
30163 *v = val;
30164 }
30165 __struct.valid_points = buf.get_u8()?;
30166 Ok(__struct)
30167 }
30168 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30169 let mut __tmp = BytesMut::new(bytes);
30170 #[allow(clippy::absurd_extreme_comparisons)]
30171 #[allow(unused_comparisons)]
30172 if __tmp.remaining() < Self::ENCODED_LEN {
30173 panic!(
30174 "buffer is too small (need {} bytes, but got {})",
30175 Self::ENCODED_LEN,
30176 __tmp.remaining(),
30177 )
30178 }
30179 __tmp.put_u64_le(self.time_usec);
30180 for val in &self.pos_x {
30181 __tmp.put_f32_le(*val);
30182 }
30183 for val in &self.pos_y {
30184 __tmp.put_f32_le(*val);
30185 }
30186 for val in &self.pos_z {
30187 __tmp.put_f32_le(*val);
30188 }
30189 for val in &self.delta {
30190 __tmp.put_f32_le(*val);
30191 }
30192 for val in &self.pos_yaw {
30193 __tmp.put_f32_le(*val);
30194 }
30195 __tmp.put_u8(self.valid_points);
30196 if matches!(version, MavlinkVersion::V2) {
30197 let len = __tmp.len();
30198 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30199 } else {
30200 __tmp.len()
30201 }
30202 }
30203}
30204#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30205#[doc = ""]
30206#[doc = "ID: 332"]
30207#[derive(Debug, Clone, PartialEq)]
30208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30210#[cfg_attr(feature = "ts", derive(TS))]
30211#[cfg_attr(feature = "ts", ts(export))]
30212pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30213 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30214 pub time_usec: u64,
30215 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30217 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30218 pub pos_x: [f32; 5],
30219 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30221 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30222 pub pos_y: [f32; 5],
30223 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30225 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30226 pub pos_z: [f32; 5],
30227 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30229 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30230 pub vel_x: [f32; 5],
30231 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30233 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30234 pub vel_y: [f32; 5],
30235 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30236 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30237 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30238 pub vel_z: [f32; 5],
30239 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30240 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30241 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30242 pub acc_x: [f32; 5],
30243 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30244 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30245 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30246 pub acc_y: [f32; 5],
30247 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30249 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30250 pub acc_z: [f32; 5],
30251 #[doc = "Yaw angle, set to NaN if not being used"]
30252 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30253 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30254 pub pos_yaw: [f32; 5],
30255 #[doc = "Yaw rate, set to NaN if not being used"]
30256 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30257 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30258 pub vel_yaw: [f32; 5],
30259 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30260 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30261 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30262 pub command: [u16; 5],
30263 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30264 pub valid_points: u8,
30265}
30266impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30267 pub const ENCODED_LEN: usize = 239usize;
30268 pub const DEFAULT: Self = Self {
30269 time_usec: 0_u64,
30270 pos_x: [0.0_f32; 5usize],
30271 pos_y: [0.0_f32; 5usize],
30272 pos_z: [0.0_f32; 5usize],
30273 vel_x: [0.0_f32; 5usize],
30274 vel_y: [0.0_f32; 5usize],
30275 vel_z: [0.0_f32; 5usize],
30276 acc_x: [0.0_f32; 5usize],
30277 acc_y: [0.0_f32; 5usize],
30278 acc_z: [0.0_f32; 5usize],
30279 pos_yaw: [0.0_f32; 5usize],
30280 vel_yaw: [0.0_f32; 5usize],
30281 command: [0_u16; 5usize],
30282 valid_points: 0_u8,
30283 };
30284 #[cfg(feature = "arbitrary")]
30285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30286 use arbitrary::{Arbitrary, Unstructured};
30287 let mut buf = [0u8; 1024];
30288 rng.fill_bytes(&mut buf);
30289 let mut unstructured = Unstructured::new(&buf);
30290 Self::arbitrary(&mut unstructured).unwrap_or_default()
30291 }
30292}
30293impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30294 fn default() -> Self {
30295 Self::DEFAULT.clone()
30296 }
30297}
30298impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30299 type Message = MavMessage;
30300 const ID: u32 = 332u32;
30301 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30302 const EXTRA_CRC: u8 = 236u8;
30303 const ENCODED_LEN: usize = 239usize;
30304 fn deser(
30305 _version: MavlinkVersion,
30306 __input: &[u8],
30307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30308 let avail_len = __input.len();
30309 let mut payload_buf = [0; Self::ENCODED_LEN];
30310 let mut buf = if avail_len < Self::ENCODED_LEN {
30311 payload_buf[0..avail_len].copy_from_slice(__input);
30312 Bytes::new(&payload_buf)
30313 } else {
30314 Bytes::new(__input)
30315 };
30316 let mut __struct = Self::default();
30317 __struct.time_usec = buf.get_u64_le()?;
30318 for v in &mut __struct.pos_x {
30319 let val = buf.get_f32_le()?;
30320 *v = val;
30321 }
30322 for v in &mut __struct.pos_y {
30323 let val = buf.get_f32_le()?;
30324 *v = val;
30325 }
30326 for v in &mut __struct.pos_z {
30327 let val = buf.get_f32_le()?;
30328 *v = val;
30329 }
30330 for v in &mut __struct.vel_x {
30331 let val = buf.get_f32_le()?;
30332 *v = val;
30333 }
30334 for v in &mut __struct.vel_y {
30335 let val = buf.get_f32_le()?;
30336 *v = val;
30337 }
30338 for v in &mut __struct.vel_z {
30339 let val = buf.get_f32_le()?;
30340 *v = val;
30341 }
30342 for v in &mut __struct.acc_x {
30343 let val = buf.get_f32_le()?;
30344 *v = val;
30345 }
30346 for v in &mut __struct.acc_y {
30347 let val = buf.get_f32_le()?;
30348 *v = val;
30349 }
30350 for v in &mut __struct.acc_z {
30351 let val = buf.get_f32_le()?;
30352 *v = val;
30353 }
30354 for v in &mut __struct.pos_yaw {
30355 let val = buf.get_f32_le()?;
30356 *v = val;
30357 }
30358 for v in &mut __struct.vel_yaw {
30359 let val = buf.get_f32_le()?;
30360 *v = val;
30361 }
30362 for v in &mut __struct.command {
30363 let val = buf.get_u16_le()?;
30364 *v = val;
30365 }
30366 __struct.valid_points = buf.get_u8()?;
30367 Ok(__struct)
30368 }
30369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30370 let mut __tmp = BytesMut::new(bytes);
30371 #[allow(clippy::absurd_extreme_comparisons)]
30372 #[allow(unused_comparisons)]
30373 if __tmp.remaining() < Self::ENCODED_LEN {
30374 panic!(
30375 "buffer is too small (need {} bytes, but got {})",
30376 Self::ENCODED_LEN,
30377 __tmp.remaining(),
30378 )
30379 }
30380 __tmp.put_u64_le(self.time_usec);
30381 for val in &self.pos_x {
30382 __tmp.put_f32_le(*val);
30383 }
30384 for val in &self.pos_y {
30385 __tmp.put_f32_le(*val);
30386 }
30387 for val in &self.pos_z {
30388 __tmp.put_f32_le(*val);
30389 }
30390 for val in &self.vel_x {
30391 __tmp.put_f32_le(*val);
30392 }
30393 for val in &self.vel_y {
30394 __tmp.put_f32_le(*val);
30395 }
30396 for val in &self.vel_z {
30397 __tmp.put_f32_le(*val);
30398 }
30399 for val in &self.acc_x {
30400 __tmp.put_f32_le(*val);
30401 }
30402 for val in &self.acc_y {
30403 __tmp.put_f32_le(*val);
30404 }
30405 for val in &self.acc_z {
30406 __tmp.put_f32_le(*val);
30407 }
30408 for val in &self.pos_yaw {
30409 __tmp.put_f32_le(*val);
30410 }
30411 for val in &self.vel_yaw {
30412 __tmp.put_f32_le(*val);
30413 }
30414 for val in &self.command {
30415 __tmp.put_u16_le(*val);
30416 }
30417 __tmp.put_u8(self.valid_points);
30418 if matches!(version, MavlinkVersion::V2) {
30419 let len = __tmp.len();
30420 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30421 } else {
30422 __tmp.len()
30423 }
30424 }
30425}
30426#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30427#[doc = ""]
30428#[doc = "ID: 385"]
30429#[derive(Debug, Clone, PartialEq)]
30430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30432#[cfg_attr(feature = "ts", derive(TS))]
30433#[cfg_attr(feature = "ts", ts(export))]
30434pub struct TUNNEL_DATA {
30435 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30436 pub payload_type: MavTunnelPayloadType,
30437 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30438 pub target_system: u8,
30439 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30440 pub target_component: u8,
30441 #[doc = "Length of the data transported in payload"]
30442 pub payload_length: u8,
30443 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30445 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30446 pub payload: [u8; 128],
30447}
30448impl TUNNEL_DATA {
30449 pub const ENCODED_LEN: usize = 133usize;
30450 pub const DEFAULT: Self = Self {
30451 payload_type: MavTunnelPayloadType::DEFAULT,
30452 target_system: 0_u8,
30453 target_component: 0_u8,
30454 payload_length: 0_u8,
30455 payload: [0_u8; 128usize],
30456 };
30457 #[cfg(feature = "arbitrary")]
30458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30459 use arbitrary::{Arbitrary, Unstructured};
30460 let mut buf = [0u8; 1024];
30461 rng.fill_bytes(&mut buf);
30462 let mut unstructured = Unstructured::new(&buf);
30463 Self::arbitrary(&mut unstructured).unwrap_or_default()
30464 }
30465}
30466impl Default for TUNNEL_DATA {
30467 fn default() -> Self {
30468 Self::DEFAULT.clone()
30469 }
30470}
30471impl MessageData for TUNNEL_DATA {
30472 type Message = MavMessage;
30473 const ID: u32 = 385u32;
30474 const NAME: &'static str = "TUNNEL";
30475 const EXTRA_CRC: u8 = 147u8;
30476 const ENCODED_LEN: usize = 133usize;
30477 fn deser(
30478 _version: MavlinkVersion,
30479 __input: &[u8],
30480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30481 let avail_len = __input.len();
30482 let mut payload_buf = [0; Self::ENCODED_LEN];
30483 let mut buf = if avail_len < Self::ENCODED_LEN {
30484 payload_buf[0..avail_len].copy_from_slice(__input);
30485 Bytes::new(&payload_buf)
30486 } else {
30487 Bytes::new(__input)
30488 };
30489 let mut __struct = Self::default();
30490 let tmp = buf.get_u16_le()?;
30491 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30492 ::mavlink_core::error::ParserError::InvalidEnum {
30493 enum_type: "MavTunnelPayloadType",
30494 value: tmp as u64,
30495 },
30496 )?;
30497 __struct.target_system = buf.get_u8()?;
30498 __struct.target_component = buf.get_u8()?;
30499 __struct.payload_length = buf.get_u8()?;
30500 for v in &mut __struct.payload {
30501 let val = buf.get_u8()?;
30502 *v = val;
30503 }
30504 Ok(__struct)
30505 }
30506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30507 let mut __tmp = BytesMut::new(bytes);
30508 #[allow(clippy::absurd_extreme_comparisons)]
30509 #[allow(unused_comparisons)]
30510 if __tmp.remaining() < Self::ENCODED_LEN {
30511 panic!(
30512 "buffer is too small (need {} bytes, but got {})",
30513 Self::ENCODED_LEN,
30514 __tmp.remaining(),
30515 )
30516 }
30517 __tmp.put_u16_le(self.payload_type as u16);
30518 __tmp.put_u8(self.target_system);
30519 __tmp.put_u8(self.target_component);
30520 __tmp.put_u8(self.payload_length);
30521 for val in &self.payload {
30522 __tmp.put_u8(*val);
30523 }
30524 if matches!(version, MavlinkVersion::V2) {
30525 let len = __tmp.len();
30526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30527 } else {
30528 __tmp.len()
30529 }
30530 }
30531}
30532#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30533#[doc = ""]
30534#[doc = "ID: 311"]
30535#[derive(Debug, Clone, PartialEq)]
30536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30538#[cfg_attr(feature = "ts", derive(TS))]
30539#[cfg_attr(feature = "ts", ts(export))]
30540pub struct UAVCAN_NODE_INFO_DATA {
30541 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30542 pub time_usec: u64,
30543 #[doc = "Time since the start-up of the node."]
30544 pub uptime_sec: u32,
30545 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30546 pub sw_vcs_commit: u32,
30547 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30548 #[cfg_attr(feature = "ts", ts(type = "string"))]
30549 pub name: CharArray<80>,
30550 #[doc = "Hardware major version number."]
30551 pub hw_version_major: u8,
30552 #[doc = "Hardware minor version number."]
30553 pub hw_version_minor: u8,
30554 #[doc = "Hardware unique 128-bit ID."]
30555 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30556 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30557 pub hw_unique_id: [u8; 16],
30558 #[doc = "Software major version number."]
30559 pub sw_version_major: u8,
30560 #[doc = "Software minor version number."]
30561 pub sw_version_minor: u8,
30562}
30563impl UAVCAN_NODE_INFO_DATA {
30564 pub const ENCODED_LEN: usize = 116usize;
30565 pub const DEFAULT: Self = Self {
30566 time_usec: 0_u64,
30567 uptime_sec: 0_u32,
30568 sw_vcs_commit: 0_u32,
30569 name: CharArray::new([0_u8; 80usize]),
30570 hw_version_major: 0_u8,
30571 hw_version_minor: 0_u8,
30572 hw_unique_id: [0_u8; 16usize],
30573 sw_version_major: 0_u8,
30574 sw_version_minor: 0_u8,
30575 };
30576 #[cfg(feature = "arbitrary")]
30577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30578 use arbitrary::{Arbitrary, Unstructured};
30579 let mut buf = [0u8; 1024];
30580 rng.fill_bytes(&mut buf);
30581 let mut unstructured = Unstructured::new(&buf);
30582 Self::arbitrary(&mut unstructured).unwrap_or_default()
30583 }
30584}
30585impl Default for UAVCAN_NODE_INFO_DATA {
30586 fn default() -> Self {
30587 Self::DEFAULT.clone()
30588 }
30589}
30590impl MessageData for UAVCAN_NODE_INFO_DATA {
30591 type Message = MavMessage;
30592 const ID: u32 = 311u32;
30593 const NAME: &'static str = "UAVCAN_NODE_INFO";
30594 const EXTRA_CRC: u8 = 95u8;
30595 const ENCODED_LEN: usize = 116usize;
30596 fn deser(
30597 _version: MavlinkVersion,
30598 __input: &[u8],
30599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30600 let avail_len = __input.len();
30601 let mut payload_buf = [0; Self::ENCODED_LEN];
30602 let mut buf = if avail_len < Self::ENCODED_LEN {
30603 payload_buf[0..avail_len].copy_from_slice(__input);
30604 Bytes::new(&payload_buf)
30605 } else {
30606 Bytes::new(__input)
30607 };
30608 let mut __struct = Self::default();
30609 __struct.time_usec = buf.get_u64_le()?;
30610 __struct.uptime_sec = buf.get_u32_le()?;
30611 __struct.sw_vcs_commit = buf.get_u32_le()?;
30612 let mut tmp = [0_u8; 80usize];
30613 for v in &mut tmp {
30614 *v = buf.get_u8()?;
30615 }
30616 __struct.name = CharArray::new(tmp);
30617 __struct.hw_version_major = buf.get_u8()?;
30618 __struct.hw_version_minor = buf.get_u8()?;
30619 for v in &mut __struct.hw_unique_id {
30620 let val = buf.get_u8()?;
30621 *v = val;
30622 }
30623 __struct.sw_version_major = buf.get_u8()?;
30624 __struct.sw_version_minor = buf.get_u8()?;
30625 Ok(__struct)
30626 }
30627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30628 let mut __tmp = BytesMut::new(bytes);
30629 #[allow(clippy::absurd_extreme_comparisons)]
30630 #[allow(unused_comparisons)]
30631 if __tmp.remaining() < Self::ENCODED_LEN {
30632 panic!(
30633 "buffer is too small (need {} bytes, but got {})",
30634 Self::ENCODED_LEN,
30635 __tmp.remaining(),
30636 )
30637 }
30638 __tmp.put_u64_le(self.time_usec);
30639 __tmp.put_u32_le(self.uptime_sec);
30640 __tmp.put_u32_le(self.sw_vcs_commit);
30641 for val in &self.name {
30642 __tmp.put_u8(*val);
30643 }
30644 __tmp.put_u8(self.hw_version_major);
30645 __tmp.put_u8(self.hw_version_minor);
30646 for val in &self.hw_unique_id {
30647 __tmp.put_u8(*val);
30648 }
30649 __tmp.put_u8(self.sw_version_major);
30650 __tmp.put_u8(self.sw_version_minor);
30651 if matches!(version, MavlinkVersion::V2) {
30652 let len = __tmp.len();
30653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30654 } else {
30655 __tmp.len()
30656 }
30657 }
30658}
30659#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30660#[doc = ""]
30661#[doc = "ID: 310"]
30662#[derive(Debug, Clone, PartialEq)]
30663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30665#[cfg_attr(feature = "ts", derive(TS))]
30666#[cfg_attr(feature = "ts", ts(export))]
30667pub struct UAVCAN_NODE_STATUS_DATA {
30668 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30669 pub time_usec: u64,
30670 #[doc = "Time since the start-up of the node."]
30671 pub uptime_sec: u32,
30672 #[doc = "Vendor-specific status information."]
30673 pub vendor_specific_status_code: u16,
30674 #[doc = "Generalized node health status."]
30675 pub health: UavcanNodeHealth,
30676 #[doc = "Generalized operating mode."]
30677 pub mode: UavcanNodeMode,
30678 #[doc = "Not used currently."]
30679 pub sub_mode: u8,
30680}
30681impl UAVCAN_NODE_STATUS_DATA {
30682 pub const ENCODED_LEN: usize = 17usize;
30683 pub const DEFAULT: Self = Self {
30684 time_usec: 0_u64,
30685 uptime_sec: 0_u32,
30686 vendor_specific_status_code: 0_u16,
30687 health: UavcanNodeHealth::DEFAULT,
30688 mode: UavcanNodeMode::DEFAULT,
30689 sub_mode: 0_u8,
30690 };
30691 #[cfg(feature = "arbitrary")]
30692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30693 use arbitrary::{Arbitrary, Unstructured};
30694 let mut buf = [0u8; 1024];
30695 rng.fill_bytes(&mut buf);
30696 let mut unstructured = Unstructured::new(&buf);
30697 Self::arbitrary(&mut unstructured).unwrap_or_default()
30698 }
30699}
30700impl Default for UAVCAN_NODE_STATUS_DATA {
30701 fn default() -> Self {
30702 Self::DEFAULT.clone()
30703 }
30704}
30705impl MessageData for UAVCAN_NODE_STATUS_DATA {
30706 type Message = MavMessage;
30707 const ID: u32 = 310u32;
30708 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30709 const EXTRA_CRC: u8 = 28u8;
30710 const ENCODED_LEN: usize = 17usize;
30711 fn deser(
30712 _version: MavlinkVersion,
30713 __input: &[u8],
30714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30715 let avail_len = __input.len();
30716 let mut payload_buf = [0; Self::ENCODED_LEN];
30717 let mut buf = if avail_len < Self::ENCODED_LEN {
30718 payload_buf[0..avail_len].copy_from_slice(__input);
30719 Bytes::new(&payload_buf)
30720 } else {
30721 Bytes::new(__input)
30722 };
30723 let mut __struct = Self::default();
30724 __struct.time_usec = buf.get_u64_le()?;
30725 __struct.uptime_sec = buf.get_u32_le()?;
30726 __struct.vendor_specific_status_code = buf.get_u16_le()?;
30727 let tmp = buf.get_u8()?;
30728 __struct.health =
30729 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30730 enum_type: "UavcanNodeHealth",
30731 value: tmp as u64,
30732 })?;
30733 let tmp = buf.get_u8()?;
30734 __struct.mode =
30735 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30736 enum_type: "UavcanNodeMode",
30737 value: tmp as u64,
30738 })?;
30739 __struct.sub_mode = buf.get_u8()?;
30740 Ok(__struct)
30741 }
30742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30743 let mut __tmp = BytesMut::new(bytes);
30744 #[allow(clippy::absurd_extreme_comparisons)]
30745 #[allow(unused_comparisons)]
30746 if __tmp.remaining() < Self::ENCODED_LEN {
30747 panic!(
30748 "buffer is too small (need {} bytes, but got {})",
30749 Self::ENCODED_LEN,
30750 __tmp.remaining(),
30751 )
30752 }
30753 __tmp.put_u64_le(self.time_usec);
30754 __tmp.put_u32_le(self.uptime_sec);
30755 __tmp.put_u16_le(self.vendor_specific_status_code);
30756 __tmp.put_u8(self.health as u8);
30757 __tmp.put_u8(self.mode as u8);
30758 __tmp.put_u8(self.sub_mode);
30759 if matches!(version, MavlinkVersion::V2) {
30760 let len = __tmp.len();
30761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30762 } else {
30763 __tmp.len()
30764 }
30765 }
30766}
30767#[doc = "Request messages."]
30768#[doc = ""]
30769#[doc = "ID: 10006"]
30770#[derive(Debug, Clone, PartialEq)]
30771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30773#[cfg_attr(feature = "ts", derive(TS))]
30774#[cfg_attr(feature = "ts", ts(export))]
30775pub struct UAVIONIX_ADSB_GET_DATA {
30776 #[doc = "Message ID to request. Supports any message in this 10000-10099 range"]
30777 pub ReqMessageId: u32,
30778}
30779impl UAVIONIX_ADSB_GET_DATA {
30780 pub const ENCODED_LEN: usize = 4usize;
30781 pub const DEFAULT: Self = Self {
30782 ReqMessageId: 0_u32,
30783 };
30784 #[cfg(feature = "arbitrary")]
30785 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30786 use arbitrary::{Arbitrary, Unstructured};
30787 let mut buf = [0u8; 1024];
30788 rng.fill_bytes(&mut buf);
30789 let mut unstructured = Unstructured::new(&buf);
30790 Self::arbitrary(&mut unstructured).unwrap_or_default()
30791 }
30792}
30793impl Default for UAVIONIX_ADSB_GET_DATA {
30794 fn default() -> Self {
30795 Self::DEFAULT.clone()
30796 }
30797}
30798impl MessageData for UAVIONIX_ADSB_GET_DATA {
30799 type Message = MavMessage;
30800 const ID: u32 = 10006u32;
30801 const NAME: &'static str = "UAVIONIX_ADSB_GET";
30802 const EXTRA_CRC: u8 = 193u8;
30803 const ENCODED_LEN: usize = 4usize;
30804 fn deser(
30805 _version: MavlinkVersion,
30806 __input: &[u8],
30807 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30808 let avail_len = __input.len();
30809 let mut payload_buf = [0; Self::ENCODED_LEN];
30810 let mut buf = if avail_len < Self::ENCODED_LEN {
30811 payload_buf[0..avail_len].copy_from_slice(__input);
30812 Bytes::new(&payload_buf)
30813 } else {
30814 Bytes::new(__input)
30815 };
30816 let mut __struct = Self::default();
30817 __struct.ReqMessageId = buf.get_u32_le()?;
30818 Ok(__struct)
30819 }
30820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30821 let mut __tmp = BytesMut::new(bytes);
30822 #[allow(clippy::absurd_extreme_comparisons)]
30823 #[allow(unused_comparisons)]
30824 if __tmp.remaining() < Self::ENCODED_LEN {
30825 panic!(
30826 "buffer is too small (need {} bytes, but got {})",
30827 Self::ENCODED_LEN,
30828 __tmp.remaining(),
30829 )
30830 }
30831 __tmp.put_u32_le(self.ReqMessageId);
30832 if matches!(version, MavlinkVersion::V2) {
30833 let len = __tmp.len();
30834 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30835 } else {
30836 __tmp.len()
30837 }
30838 }
30839}
30840#[doc = "Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter)."]
30841#[doc = ""]
30842#[doc = "ID: 10001"]
30843#[derive(Debug, Clone, PartialEq)]
30844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30846#[cfg_attr(feature = "ts", derive(TS))]
30847#[cfg_attr(feature = "ts", ts(export))]
30848pub struct UAVIONIX_ADSB_OUT_CFG_DATA {
30849 #[doc = "Vehicle address (24 bit)"]
30850 pub ICAO: u32,
30851 #[doc = "Aircraft stall speed in cm/s"]
30852 pub stallSpeed: u16,
30853 #[doc = "Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, \" \" only)"]
30854 #[cfg_attr(feature = "ts", ts(type = "string"))]
30855 pub callsign: CharArray<9>,
30856 #[doc = "Transmitting vehicle type. See ADSB_EMITTER_TYPE enum"]
30857 pub emitterType: AdsbEmitterType,
30858 #[doc = "Aircraft length and width encoding (table 2-35 of DO-282B)"]
30859 pub aircraftSize: UavionixAdsbOutCfgAircraftSize,
30860 #[doc = "GPS antenna lateral offset (table 2-36 of DO-282B)"]
30861 pub gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat,
30862 #[doc = "GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)"]
30863 pub gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon,
30864 #[doc = "ADS-B transponder reciever and transmit enable flags"]
30865 pub rfSelect: UavionixAdsbOutRfSelect,
30866}
30867impl UAVIONIX_ADSB_OUT_CFG_DATA {
30868 pub const ENCODED_LEN: usize = 20usize;
30869 pub const DEFAULT: Self = Self {
30870 ICAO: 0_u32,
30871 stallSpeed: 0_u16,
30872 callsign: CharArray::new([0_u8; 9usize]),
30873 emitterType: AdsbEmitterType::DEFAULT,
30874 aircraftSize: UavionixAdsbOutCfgAircraftSize::DEFAULT,
30875 gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat::DEFAULT,
30876 gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon::DEFAULT,
30877 rfSelect: UavionixAdsbOutRfSelect::DEFAULT,
30878 };
30879 #[cfg(feature = "arbitrary")]
30880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30881 use arbitrary::{Arbitrary, Unstructured};
30882 let mut buf = [0u8; 1024];
30883 rng.fill_bytes(&mut buf);
30884 let mut unstructured = Unstructured::new(&buf);
30885 Self::arbitrary(&mut unstructured).unwrap_or_default()
30886 }
30887}
30888impl Default for UAVIONIX_ADSB_OUT_CFG_DATA {
30889 fn default() -> Self {
30890 Self::DEFAULT.clone()
30891 }
30892}
30893impl MessageData for UAVIONIX_ADSB_OUT_CFG_DATA {
30894 type Message = MavMessage;
30895 const ID: u32 = 10001u32;
30896 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG";
30897 const EXTRA_CRC: u8 = 209u8;
30898 const ENCODED_LEN: usize = 20usize;
30899 fn deser(
30900 _version: MavlinkVersion,
30901 __input: &[u8],
30902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30903 let avail_len = __input.len();
30904 let mut payload_buf = [0; Self::ENCODED_LEN];
30905 let mut buf = if avail_len < Self::ENCODED_LEN {
30906 payload_buf[0..avail_len].copy_from_slice(__input);
30907 Bytes::new(&payload_buf)
30908 } else {
30909 Bytes::new(__input)
30910 };
30911 let mut __struct = Self::default();
30912 __struct.ICAO = buf.get_u32_le()?;
30913 __struct.stallSpeed = buf.get_u16_le()?;
30914 let mut tmp = [0_u8; 9usize];
30915 for v in &mut tmp {
30916 *v = buf.get_u8()?;
30917 }
30918 __struct.callsign = CharArray::new(tmp);
30919 let tmp = buf.get_u8()?;
30920 __struct.emitterType =
30921 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30922 enum_type: "AdsbEmitterType",
30923 value: tmp as u64,
30924 })?;
30925 let tmp = buf.get_u8()?;
30926 __struct.aircraftSize =
30927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30928 enum_type: "UavionixAdsbOutCfgAircraftSize",
30929 value: tmp as u64,
30930 })?;
30931 let tmp = buf.get_u8()?;
30932 __struct.gpsOffsetLat =
30933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30934 enum_type: "UavionixAdsbOutCfgGpsOffsetLat",
30935 value: tmp as u64,
30936 })?;
30937 let tmp = buf.get_u8()?;
30938 __struct.gpsOffsetLon =
30939 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30940 enum_type: "UavionixAdsbOutCfgGpsOffsetLon",
30941 value: tmp as u64,
30942 })?;
30943 let tmp = buf.get_u8()?;
30944 __struct.rfSelect =
30945 UavionixAdsbOutRfSelect::from_bits(tmp as <UavionixAdsbOutRfSelect as Flags>::Bits)
30946 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30947 flag_type: "UavionixAdsbOutRfSelect",
30948 value: tmp as u64,
30949 })?;
30950 Ok(__struct)
30951 }
30952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30953 let mut __tmp = BytesMut::new(bytes);
30954 #[allow(clippy::absurd_extreme_comparisons)]
30955 #[allow(unused_comparisons)]
30956 if __tmp.remaining() < Self::ENCODED_LEN {
30957 panic!(
30958 "buffer is too small (need {} bytes, but got {})",
30959 Self::ENCODED_LEN,
30960 __tmp.remaining(),
30961 )
30962 }
30963 __tmp.put_u32_le(self.ICAO);
30964 __tmp.put_u16_le(self.stallSpeed);
30965 for val in &self.callsign {
30966 __tmp.put_u8(*val);
30967 }
30968 __tmp.put_u8(self.emitterType as u8);
30969 __tmp.put_u8(self.aircraftSize as u8);
30970 __tmp.put_u8(self.gpsOffsetLat as u8);
30971 __tmp.put_u8(self.gpsOffsetLon as u8);
30972 __tmp.put_u8(self.rfSelect.bits() as u8);
30973 if matches!(version, MavlinkVersion::V2) {
30974 let len = __tmp.len();
30975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30976 } else {
30977 __tmp.len()
30978 }
30979 }
30980}
30981#[doc = "Flight Identification for ADSB-Out vehicles."]
30982#[doc = ""]
30983#[doc = "ID: 10005"]
30984#[derive(Debug, Clone, PartialEq)]
30985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30987#[cfg_attr(feature = "ts", derive(TS))]
30988#[cfg_attr(feature = "ts", ts(export))]
30989pub struct UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
30990 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. Reflects Control message setting. This is null-terminated."]
30991 #[cfg_attr(feature = "ts", ts(type = "string"))]
30992 pub flight_id: CharArray<9>,
30993}
30994impl UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
30995 pub const ENCODED_LEN: usize = 9usize;
30996 pub const DEFAULT: Self = Self {
30997 flight_id: CharArray::new([0_u8; 9usize]),
30998 };
30999 #[cfg(feature = "arbitrary")]
31000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31001 use arbitrary::{Arbitrary, Unstructured};
31002 let mut buf = [0u8; 1024];
31003 rng.fill_bytes(&mut buf);
31004 let mut unstructured = Unstructured::new(&buf);
31005 Self::arbitrary(&mut unstructured).unwrap_or_default()
31006 }
31007}
31008impl Default for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
31009 fn default() -> Self {
31010 Self::DEFAULT.clone()
31011 }
31012}
31013impl MessageData for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
31014 type Message = MavMessage;
31015 const ID: u32 = 10005u32;
31016 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_FLIGHTID";
31017 const EXTRA_CRC: u8 = 103u8;
31018 const ENCODED_LEN: usize = 9usize;
31019 fn deser(
31020 _version: MavlinkVersion,
31021 __input: &[u8],
31022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31023 let avail_len = __input.len();
31024 let mut payload_buf = [0; Self::ENCODED_LEN];
31025 let mut buf = if avail_len < Self::ENCODED_LEN {
31026 payload_buf[0..avail_len].copy_from_slice(__input);
31027 Bytes::new(&payload_buf)
31028 } else {
31029 Bytes::new(__input)
31030 };
31031 let mut __struct = Self::default();
31032 let mut tmp = [0_u8; 9usize];
31033 for v in &mut tmp {
31034 *v = buf.get_u8()?;
31035 }
31036 __struct.flight_id = CharArray::new(tmp);
31037 Ok(__struct)
31038 }
31039 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31040 let mut __tmp = BytesMut::new(bytes);
31041 #[allow(clippy::absurd_extreme_comparisons)]
31042 #[allow(unused_comparisons)]
31043 if __tmp.remaining() < Self::ENCODED_LEN {
31044 panic!(
31045 "buffer is too small (need {} bytes, but got {})",
31046 Self::ENCODED_LEN,
31047 __tmp.remaining(),
31048 )
31049 }
31050 for val in &self.flight_id {
31051 __tmp.put_u8(*val);
31052 }
31053 if matches!(version, MavlinkVersion::V2) {
31054 let len = __tmp.len();
31055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31056 } else {
31057 __tmp.len()
31058 }
31059 }
31060}
31061#[doc = "Aircraft Registration."]
31062#[doc = ""]
31063#[doc = "ID: 10004"]
31064#[derive(Debug, Clone, PartialEq)]
31065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31067#[cfg_attr(feature = "ts", derive(TS))]
31068#[cfg_attr(feature = "ts", ts(export))]
31069pub struct UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
31070 #[doc = "Aircraft Registration (ASCII string A-Z, 0-9 only), e.g. \"N8644B \". Trailing spaces (0x20) only. This is null-terminated."]
31071 #[cfg_attr(feature = "ts", ts(type = "string"))]
31072 pub registration: CharArray<9>,
31073}
31074impl UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
31075 pub const ENCODED_LEN: usize = 9usize;
31076 pub const DEFAULT: Self = Self {
31077 registration: CharArray::new([0_u8; 9usize]),
31078 };
31079 #[cfg(feature = "arbitrary")]
31080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31081 use arbitrary::{Arbitrary, Unstructured};
31082 let mut buf = [0u8; 1024];
31083 rng.fill_bytes(&mut buf);
31084 let mut unstructured = Unstructured::new(&buf);
31085 Self::arbitrary(&mut unstructured).unwrap_or_default()
31086 }
31087}
31088impl Default for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
31089 fn default() -> Self {
31090 Self::DEFAULT.clone()
31091 }
31092}
31093impl MessageData for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
31094 type Message = MavMessage;
31095 const ID: u32 = 10004u32;
31096 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_REGISTRATION";
31097 const EXTRA_CRC: u8 = 133u8;
31098 const ENCODED_LEN: usize = 9usize;
31099 fn deser(
31100 _version: MavlinkVersion,
31101 __input: &[u8],
31102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31103 let avail_len = __input.len();
31104 let mut payload_buf = [0; Self::ENCODED_LEN];
31105 let mut buf = if avail_len < Self::ENCODED_LEN {
31106 payload_buf[0..avail_len].copy_from_slice(__input);
31107 Bytes::new(&payload_buf)
31108 } else {
31109 Bytes::new(__input)
31110 };
31111 let mut __struct = Self::default();
31112 let mut tmp = [0_u8; 9usize];
31113 for v in &mut tmp {
31114 *v = buf.get_u8()?;
31115 }
31116 __struct.registration = CharArray::new(tmp);
31117 Ok(__struct)
31118 }
31119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31120 let mut __tmp = BytesMut::new(bytes);
31121 #[allow(clippy::absurd_extreme_comparisons)]
31122 #[allow(unused_comparisons)]
31123 if __tmp.remaining() < Self::ENCODED_LEN {
31124 panic!(
31125 "buffer is too small (need {} bytes, but got {})",
31126 Self::ENCODED_LEN,
31127 __tmp.remaining(),
31128 )
31129 }
31130 for val in &self.registration {
31131 __tmp.put_u8(*val);
31132 }
31133 if matches!(version, MavlinkVersion::V2) {
31134 let len = __tmp.len();
31135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31136 } else {
31137 __tmp.len()
31138 }
31139 }
31140}
31141#[doc = "Control message with all data sent in UCP control message."]
31142#[doc = ""]
31143#[doc = "ID: 10007"]
31144#[derive(Debug, Clone, PartialEq)]
31145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31147#[cfg_attr(feature = "ts", derive(TS))]
31148#[cfg_attr(feature = "ts", ts(export))]
31149pub struct UAVIONIX_ADSB_OUT_CONTROL_DATA {
31150 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
31151 pub baroAltMSL: i32,
31152 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
31153 pub squawk: u16,
31154 #[doc = "ADS-B transponder control state flags"]
31155 pub state: UavionixAdsbOutControlState,
31156 #[doc = "Emergency status"]
31157 pub emergencyStatus: UavionixAdsbEmergencyStatus,
31158 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
31159 #[cfg_attr(feature = "ts", ts(type = "string"))]
31160 pub flight_id: CharArray<8>,
31161 #[doc = "X-Bit enable (military transponders only)"]
31162 pub x_bit: UavionixAdsbXbit,
31163}
31164impl UAVIONIX_ADSB_OUT_CONTROL_DATA {
31165 pub const ENCODED_LEN: usize = 17usize;
31166 pub const DEFAULT: Self = Self {
31167 baroAltMSL: 0_i32,
31168 squawk: 0_u16,
31169 state: UavionixAdsbOutControlState::DEFAULT,
31170 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
31171 flight_id: CharArray::new([0_u8; 8usize]),
31172 x_bit: UavionixAdsbXbit::DEFAULT,
31173 };
31174 #[cfg(feature = "arbitrary")]
31175 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31176 use arbitrary::{Arbitrary, Unstructured};
31177 let mut buf = [0u8; 1024];
31178 rng.fill_bytes(&mut buf);
31179 let mut unstructured = Unstructured::new(&buf);
31180 Self::arbitrary(&mut unstructured).unwrap_or_default()
31181 }
31182}
31183impl Default for UAVIONIX_ADSB_OUT_CONTROL_DATA {
31184 fn default() -> Self {
31185 Self::DEFAULT.clone()
31186 }
31187}
31188impl MessageData for UAVIONIX_ADSB_OUT_CONTROL_DATA {
31189 type Message = MavMessage;
31190 const ID: u32 = 10007u32;
31191 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CONTROL";
31192 const EXTRA_CRC: u8 = 71u8;
31193 const ENCODED_LEN: usize = 17usize;
31194 fn deser(
31195 _version: MavlinkVersion,
31196 __input: &[u8],
31197 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31198 let avail_len = __input.len();
31199 let mut payload_buf = [0; Self::ENCODED_LEN];
31200 let mut buf = if avail_len < Self::ENCODED_LEN {
31201 payload_buf[0..avail_len].copy_from_slice(__input);
31202 Bytes::new(&payload_buf)
31203 } else {
31204 Bytes::new(__input)
31205 };
31206 let mut __struct = Self::default();
31207 __struct.baroAltMSL = buf.get_i32_le()?;
31208 __struct.squawk = buf.get_u16_le()?;
31209 let tmp = buf.get_u8()?;
31210 __struct.state = UavionixAdsbOutControlState::from_bits(
31211 tmp as <UavionixAdsbOutControlState as Flags>::Bits,
31212 )
31213 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31214 flag_type: "UavionixAdsbOutControlState",
31215 value: tmp as u64,
31216 })?;
31217 let tmp = buf.get_u8()?;
31218 __struct.emergencyStatus =
31219 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31220 enum_type: "UavionixAdsbEmergencyStatus",
31221 value: tmp as u64,
31222 })?;
31223 let mut tmp = [0_u8; 8usize];
31224 for v in &mut tmp {
31225 *v = buf.get_u8()?;
31226 }
31227 __struct.flight_id = CharArray::new(tmp);
31228 let tmp = buf.get_u8()?;
31229 __struct.x_bit = UavionixAdsbXbit::from_bits(tmp as <UavionixAdsbXbit as Flags>::Bits)
31230 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31231 flag_type: "UavionixAdsbXbit",
31232 value: tmp as u64,
31233 })?;
31234 Ok(__struct)
31235 }
31236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31237 let mut __tmp = BytesMut::new(bytes);
31238 #[allow(clippy::absurd_extreme_comparisons)]
31239 #[allow(unused_comparisons)]
31240 if __tmp.remaining() < Self::ENCODED_LEN {
31241 panic!(
31242 "buffer is too small (need {} bytes, but got {})",
31243 Self::ENCODED_LEN,
31244 __tmp.remaining(),
31245 )
31246 }
31247 __tmp.put_i32_le(self.baroAltMSL);
31248 __tmp.put_u16_le(self.squawk);
31249 __tmp.put_u8(self.state.bits() as u8);
31250 __tmp.put_u8(self.emergencyStatus as u8);
31251 for val in &self.flight_id {
31252 __tmp.put_u8(*val);
31253 }
31254 __tmp.put_u8(self.x_bit.bits() as u8);
31255 if matches!(version, MavlinkVersion::V2) {
31256 let len = __tmp.len();
31257 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31258 } else {
31259 __tmp.len()
31260 }
31261 }
31262}
31263#[doc = "Dynamic data used to generate ADS-B out transponder data (send at 5Hz)."]
31264#[doc = ""]
31265#[doc = "ID: 10002"]
31266#[derive(Debug, Clone, PartialEq)]
31267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31269#[cfg_attr(feature = "ts", derive(TS))]
31270#[cfg_attr(feature = "ts", ts(export))]
31271pub struct UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
31272 #[doc = "UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX"]
31273 pub utcTime: u32,
31274 #[doc = "Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
31275 pub gpsLat: i32,
31276 #[doc = "Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
31277 pub gpsLon: i32,
31278 #[doc = "Altitude (WGS84). UP +ve. If unknown set to INT32_MAX"]
31279 pub gpsAlt: i32,
31280 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
31281 pub baroAltMSL: i32,
31282 #[doc = "Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX"]
31283 pub accuracyHor: u32,
31284 #[doc = "Vertical accuracy in cm. If unknown set to UINT16_MAX"]
31285 pub accuracyVert: u16,
31286 #[doc = "Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX"]
31287 pub accuracyVel: u16,
31288 #[doc = "GPS vertical speed in cm/s. If unknown set to INT16_MAX"]
31289 pub velVert: i16,
31290 #[doc = "North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX"]
31291 pub velNS: i16,
31292 #[doc = "East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX"]
31293 pub VelEW: i16,
31294 #[doc = "ADS-B transponder dynamic input state flags"]
31295 pub state: UavionixAdsbOutDynamicState,
31296 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
31297 pub squawk: u16,
31298 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK"]
31299 pub gpsFix: UavionixAdsbOutDynamicGpsFix,
31300 #[doc = "Number of satellites visible. If unknown set to UINT8_MAX"]
31301 pub numSats: u8,
31302 #[doc = "Emergency status"]
31303 pub emergencyStatus: UavionixAdsbEmergencyStatus,
31304}
31305impl UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
31306 pub const ENCODED_LEN: usize = 41usize;
31307 pub const DEFAULT: Self = Self {
31308 utcTime: 0_u32,
31309 gpsLat: 0_i32,
31310 gpsLon: 0_i32,
31311 gpsAlt: 0_i32,
31312 baroAltMSL: 0_i32,
31313 accuracyHor: 0_u32,
31314 accuracyVert: 0_u16,
31315 accuracyVel: 0_u16,
31316 velVert: 0_i16,
31317 velNS: 0_i16,
31318 VelEW: 0_i16,
31319 state: UavionixAdsbOutDynamicState::DEFAULT,
31320 squawk: 0_u16,
31321 gpsFix: UavionixAdsbOutDynamicGpsFix::DEFAULT,
31322 numSats: 0_u8,
31323 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
31324 };
31325 #[cfg(feature = "arbitrary")]
31326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31327 use arbitrary::{Arbitrary, Unstructured};
31328 let mut buf = [0u8; 1024];
31329 rng.fill_bytes(&mut buf);
31330 let mut unstructured = Unstructured::new(&buf);
31331 Self::arbitrary(&mut unstructured).unwrap_or_default()
31332 }
31333}
31334impl Default for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
31335 fn default() -> Self {
31336 Self::DEFAULT.clone()
31337 }
31338}
31339impl MessageData for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
31340 type Message = MavMessage;
31341 const ID: u32 = 10002u32;
31342 const NAME: &'static str = "UAVIONIX_ADSB_OUT_DYNAMIC";
31343 const EXTRA_CRC: u8 = 186u8;
31344 const ENCODED_LEN: usize = 41usize;
31345 fn deser(
31346 _version: MavlinkVersion,
31347 __input: &[u8],
31348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31349 let avail_len = __input.len();
31350 let mut payload_buf = [0; Self::ENCODED_LEN];
31351 let mut buf = if avail_len < Self::ENCODED_LEN {
31352 payload_buf[0..avail_len].copy_from_slice(__input);
31353 Bytes::new(&payload_buf)
31354 } else {
31355 Bytes::new(__input)
31356 };
31357 let mut __struct = Self::default();
31358 __struct.utcTime = buf.get_u32_le()?;
31359 __struct.gpsLat = buf.get_i32_le()?;
31360 __struct.gpsLon = buf.get_i32_le()?;
31361 __struct.gpsAlt = buf.get_i32_le()?;
31362 __struct.baroAltMSL = buf.get_i32_le()?;
31363 __struct.accuracyHor = buf.get_u32_le()?;
31364 __struct.accuracyVert = buf.get_u16_le()?;
31365 __struct.accuracyVel = buf.get_u16_le()?;
31366 __struct.velVert = buf.get_i16_le()?;
31367 __struct.velNS = buf.get_i16_le()?;
31368 __struct.VelEW = buf.get_i16_le()?;
31369 let tmp = buf.get_u16_le()?;
31370 __struct.state = UavionixAdsbOutDynamicState::from_bits(
31371 tmp as <UavionixAdsbOutDynamicState as Flags>::Bits,
31372 )
31373 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31374 flag_type: "UavionixAdsbOutDynamicState",
31375 value: tmp as u64,
31376 })?;
31377 __struct.squawk = buf.get_u16_le()?;
31378 let tmp = buf.get_u8()?;
31379 __struct.gpsFix =
31380 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31381 enum_type: "UavionixAdsbOutDynamicGpsFix",
31382 value: tmp as u64,
31383 })?;
31384 __struct.numSats = buf.get_u8()?;
31385 let tmp = buf.get_u8()?;
31386 __struct.emergencyStatus =
31387 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31388 enum_type: "UavionixAdsbEmergencyStatus",
31389 value: tmp as u64,
31390 })?;
31391 Ok(__struct)
31392 }
31393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31394 let mut __tmp = BytesMut::new(bytes);
31395 #[allow(clippy::absurd_extreme_comparisons)]
31396 #[allow(unused_comparisons)]
31397 if __tmp.remaining() < Self::ENCODED_LEN {
31398 panic!(
31399 "buffer is too small (need {} bytes, but got {})",
31400 Self::ENCODED_LEN,
31401 __tmp.remaining(),
31402 )
31403 }
31404 __tmp.put_u32_le(self.utcTime);
31405 __tmp.put_i32_le(self.gpsLat);
31406 __tmp.put_i32_le(self.gpsLon);
31407 __tmp.put_i32_le(self.gpsAlt);
31408 __tmp.put_i32_le(self.baroAltMSL);
31409 __tmp.put_u32_le(self.accuracyHor);
31410 __tmp.put_u16_le(self.accuracyVert);
31411 __tmp.put_u16_le(self.accuracyVel);
31412 __tmp.put_i16_le(self.velVert);
31413 __tmp.put_i16_le(self.velNS);
31414 __tmp.put_i16_le(self.VelEW);
31415 __tmp.put_u16_le(self.state.bits() as u16);
31416 __tmp.put_u16_le(self.squawk);
31417 __tmp.put_u8(self.gpsFix as u8);
31418 __tmp.put_u8(self.numSats);
31419 __tmp.put_u8(self.emergencyStatus as u8);
31420 if matches!(version, MavlinkVersion::V2) {
31421 let len = __tmp.len();
31422 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31423 } else {
31424 __tmp.len()
31425 }
31426 }
31427}
31428#[doc = "Status message with information from UCP Heartbeat and Status messages."]
31429#[doc = ""]
31430#[doc = "ID: 10008"]
31431#[derive(Debug, Clone, PartialEq)]
31432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31434#[cfg_attr(feature = "ts", derive(TS))]
31435#[cfg_attr(feature = "ts", ts(export))]
31436pub struct UAVIONIX_ADSB_OUT_STATUS_DATA {
31437 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
31438 pub squawk: u16,
31439 #[doc = "ADS-B transponder status state flags"]
31440 pub state: UavionixAdsbOutStatusState,
31441 #[doc = "Integrity and Accuracy of traffic reported as a 4-bit value for each field (NACp 7:4, NIC 3:0) and encoded by Containment Radius (HPL) and Estimated Position Uncertainty (HFOM), respectively"]
31442 pub NIC_NACp: UavionixAdsbOutStatusNicNacp,
31443 #[doc = "Board temperature in C"]
31444 pub boardTemp: u8,
31445 #[doc = "ADS-B transponder fault flags"]
31446 pub fault: UavionixAdsbOutStatusFault,
31447 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
31448 #[cfg_attr(feature = "ts", ts(type = "string"))]
31449 pub flight_id: CharArray<8>,
31450}
31451impl UAVIONIX_ADSB_OUT_STATUS_DATA {
31452 pub const ENCODED_LEN: usize = 14usize;
31453 pub const DEFAULT: Self = Self {
31454 squawk: 0_u16,
31455 state: UavionixAdsbOutStatusState::DEFAULT,
31456 NIC_NACp: UavionixAdsbOutStatusNicNacp::DEFAULT,
31457 boardTemp: 0_u8,
31458 fault: UavionixAdsbOutStatusFault::DEFAULT,
31459 flight_id: CharArray::new([0_u8; 8usize]),
31460 };
31461 #[cfg(feature = "arbitrary")]
31462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31463 use arbitrary::{Arbitrary, Unstructured};
31464 let mut buf = [0u8; 1024];
31465 rng.fill_bytes(&mut buf);
31466 let mut unstructured = Unstructured::new(&buf);
31467 Self::arbitrary(&mut unstructured).unwrap_or_default()
31468 }
31469}
31470impl Default for UAVIONIX_ADSB_OUT_STATUS_DATA {
31471 fn default() -> Self {
31472 Self::DEFAULT.clone()
31473 }
31474}
31475impl MessageData for UAVIONIX_ADSB_OUT_STATUS_DATA {
31476 type Message = MavMessage;
31477 const ID: u32 = 10008u32;
31478 const NAME: &'static str = "UAVIONIX_ADSB_OUT_STATUS";
31479 const EXTRA_CRC: u8 = 240u8;
31480 const ENCODED_LEN: usize = 14usize;
31481 fn deser(
31482 _version: MavlinkVersion,
31483 __input: &[u8],
31484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31485 let avail_len = __input.len();
31486 let mut payload_buf = [0; Self::ENCODED_LEN];
31487 let mut buf = if avail_len < Self::ENCODED_LEN {
31488 payload_buf[0..avail_len].copy_from_slice(__input);
31489 Bytes::new(&payload_buf)
31490 } else {
31491 Bytes::new(__input)
31492 };
31493 let mut __struct = Self::default();
31494 __struct.squawk = buf.get_u16_le()?;
31495 let tmp = buf.get_u8()?;
31496 __struct.state = UavionixAdsbOutStatusState::from_bits(
31497 tmp as <UavionixAdsbOutStatusState as Flags>::Bits,
31498 )
31499 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31500 flag_type: "UavionixAdsbOutStatusState",
31501 value: tmp as u64,
31502 })?;
31503 let tmp = buf.get_u8()?;
31504 __struct.NIC_NACp =
31505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31506 enum_type: "UavionixAdsbOutStatusNicNacp",
31507 value: tmp as u64,
31508 })?;
31509 __struct.boardTemp = buf.get_u8()?;
31510 let tmp = buf.get_u8()?;
31511 __struct.fault = UavionixAdsbOutStatusFault::from_bits(
31512 tmp as <UavionixAdsbOutStatusFault as Flags>::Bits,
31513 )
31514 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31515 flag_type: "UavionixAdsbOutStatusFault",
31516 value: tmp as u64,
31517 })?;
31518 let mut tmp = [0_u8; 8usize];
31519 for v in &mut tmp {
31520 *v = buf.get_u8()?;
31521 }
31522 __struct.flight_id = CharArray::new(tmp);
31523 Ok(__struct)
31524 }
31525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31526 let mut __tmp = BytesMut::new(bytes);
31527 #[allow(clippy::absurd_extreme_comparisons)]
31528 #[allow(unused_comparisons)]
31529 if __tmp.remaining() < Self::ENCODED_LEN {
31530 panic!(
31531 "buffer is too small (need {} bytes, but got {})",
31532 Self::ENCODED_LEN,
31533 __tmp.remaining(),
31534 )
31535 }
31536 __tmp.put_u16_le(self.squawk);
31537 __tmp.put_u8(self.state.bits() as u8);
31538 __tmp.put_u8(self.NIC_NACp as u8);
31539 __tmp.put_u8(self.boardTemp);
31540 __tmp.put_u8(self.fault.bits() as u8);
31541 for val in &self.flight_id {
31542 __tmp.put_u8(*val);
31543 }
31544 if matches!(version, MavlinkVersion::V2) {
31545 let len = __tmp.len();
31546 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31547 } else {
31548 __tmp.len()
31549 }
31550 }
31551}
31552#[doc = "Transceiver heartbeat with health report (updated every 10s)."]
31553#[doc = ""]
31554#[doc = "ID: 10003"]
31555#[derive(Debug, Clone, PartialEq)]
31556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31558#[cfg_attr(feature = "ts", derive(TS))]
31559#[cfg_attr(feature = "ts", ts(export))]
31560pub struct UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
31561 #[doc = "ADS-B transponder messages"]
31562 pub rfHealth: UavionixAdsbRfHealth,
31563}
31564impl UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
31565 pub const ENCODED_LEN: usize = 1usize;
31566 pub const DEFAULT: Self = Self {
31567 rfHealth: UavionixAdsbRfHealth::DEFAULT,
31568 };
31569 #[cfg(feature = "arbitrary")]
31570 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31571 use arbitrary::{Arbitrary, Unstructured};
31572 let mut buf = [0u8; 1024];
31573 rng.fill_bytes(&mut buf);
31574 let mut unstructured = Unstructured::new(&buf);
31575 Self::arbitrary(&mut unstructured).unwrap_or_default()
31576 }
31577}
31578impl Default for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
31579 fn default() -> Self {
31580 Self::DEFAULT.clone()
31581 }
31582}
31583impl MessageData for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
31584 type Message = MavMessage;
31585 const ID: u32 = 10003u32;
31586 const NAME: &'static str = "UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT";
31587 const EXTRA_CRC: u8 = 4u8;
31588 const ENCODED_LEN: usize = 1usize;
31589 fn deser(
31590 _version: MavlinkVersion,
31591 __input: &[u8],
31592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31593 let avail_len = __input.len();
31594 let mut payload_buf = [0; Self::ENCODED_LEN];
31595 let mut buf = if avail_len < Self::ENCODED_LEN {
31596 payload_buf[0..avail_len].copy_from_slice(__input);
31597 Bytes::new(&payload_buf)
31598 } else {
31599 Bytes::new(__input)
31600 };
31601 let mut __struct = Self::default();
31602 let tmp = buf.get_u8()?;
31603 __struct.rfHealth = UavionixAdsbRfHealth::from_bits(
31604 tmp as <UavionixAdsbRfHealth as Flags>::Bits,
31605 )
31606 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31607 flag_type: "UavionixAdsbRfHealth",
31608 value: tmp as u64,
31609 })?;
31610 Ok(__struct)
31611 }
31612 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31613 let mut __tmp = BytesMut::new(bytes);
31614 #[allow(clippy::absurd_extreme_comparisons)]
31615 #[allow(unused_comparisons)]
31616 if __tmp.remaining() < Self::ENCODED_LEN {
31617 panic!(
31618 "buffer is too small (need {} bytes, but got {})",
31619 Self::ENCODED_LEN,
31620 __tmp.remaining(),
31621 )
31622 }
31623 __tmp.put_u8(self.rfHealth.bits() as u8);
31624 if matches!(version, MavlinkVersion::V2) {
31625 let len = __tmp.len();
31626 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31627 } else {
31628 __tmp.len()
31629 }
31630 }
31631}
31632#[doc = "The global position resulting from GPS and sensor fusion."]
31633#[doc = ""]
31634#[doc = "ID: 340"]
31635#[derive(Debug, Clone, PartialEq)]
31636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31638#[cfg_attr(feature = "ts", derive(TS))]
31639#[cfg_attr(feature = "ts", ts(export))]
31640pub struct UTM_GLOBAL_POSITION_DATA {
31641 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31642 pub time: u64,
31643 #[doc = "Latitude (WGS84)"]
31644 pub lat: i32,
31645 #[doc = "Longitude (WGS84)"]
31646 pub lon: i32,
31647 #[doc = "Altitude (WGS84)"]
31648 pub alt: i32,
31649 #[doc = "Altitude above ground"]
31650 pub relative_alt: i32,
31651 #[doc = "Next waypoint, latitude (WGS84)"]
31652 pub next_lat: i32,
31653 #[doc = "Next waypoint, longitude (WGS84)"]
31654 pub next_lon: i32,
31655 #[doc = "Next waypoint, altitude (WGS84)"]
31656 pub next_alt: i32,
31657 #[doc = "Ground X speed (latitude, positive north)"]
31658 pub vx: i16,
31659 #[doc = "Ground Y speed (longitude, positive east)"]
31660 pub vy: i16,
31661 #[doc = "Ground Z speed (altitude, positive down)"]
31662 pub vz: i16,
31663 #[doc = "Horizontal position uncertainty (standard deviation)"]
31664 pub h_acc: u16,
31665 #[doc = "Altitude uncertainty (standard deviation)"]
31666 pub v_acc: u16,
31667 #[doc = "Speed uncertainty (standard deviation)"]
31668 pub vel_acc: u16,
31669 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31670 pub update_rate: u16,
31671 #[doc = "Unique UAS ID."]
31672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31673 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31674 pub uas_id: [u8; 18],
31675 #[doc = "Flight state"]
31676 pub flight_state: UtmFlightState,
31677 #[doc = "Bitwise OR combination of the data available flags."]
31678 pub flags: UtmDataAvailFlags,
31679}
31680impl UTM_GLOBAL_POSITION_DATA {
31681 pub const ENCODED_LEN: usize = 70usize;
31682 pub const DEFAULT: Self = Self {
31683 time: 0_u64,
31684 lat: 0_i32,
31685 lon: 0_i32,
31686 alt: 0_i32,
31687 relative_alt: 0_i32,
31688 next_lat: 0_i32,
31689 next_lon: 0_i32,
31690 next_alt: 0_i32,
31691 vx: 0_i16,
31692 vy: 0_i16,
31693 vz: 0_i16,
31694 h_acc: 0_u16,
31695 v_acc: 0_u16,
31696 vel_acc: 0_u16,
31697 update_rate: 0_u16,
31698 uas_id: [0_u8; 18usize],
31699 flight_state: UtmFlightState::DEFAULT,
31700 flags: UtmDataAvailFlags::DEFAULT,
31701 };
31702 #[cfg(feature = "arbitrary")]
31703 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31704 use arbitrary::{Arbitrary, Unstructured};
31705 let mut buf = [0u8; 1024];
31706 rng.fill_bytes(&mut buf);
31707 let mut unstructured = Unstructured::new(&buf);
31708 Self::arbitrary(&mut unstructured).unwrap_or_default()
31709 }
31710}
31711impl Default for UTM_GLOBAL_POSITION_DATA {
31712 fn default() -> Self {
31713 Self::DEFAULT.clone()
31714 }
31715}
31716impl MessageData for UTM_GLOBAL_POSITION_DATA {
31717 type Message = MavMessage;
31718 const ID: u32 = 340u32;
31719 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31720 const EXTRA_CRC: u8 = 99u8;
31721 const ENCODED_LEN: usize = 70usize;
31722 fn deser(
31723 _version: MavlinkVersion,
31724 __input: &[u8],
31725 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31726 let avail_len = __input.len();
31727 let mut payload_buf = [0; Self::ENCODED_LEN];
31728 let mut buf = if avail_len < Self::ENCODED_LEN {
31729 payload_buf[0..avail_len].copy_from_slice(__input);
31730 Bytes::new(&payload_buf)
31731 } else {
31732 Bytes::new(__input)
31733 };
31734 let mut __struct = Self::default();
31735 __struct.time = buf.get_u64_le()?;
31736 __struct.lat = buf.get_i32_le()?;
31737 __struct.lon = buf.get_i32_le()?;
31738 __struct.alt = buf.get_i32_le()?;
31739 __struct.relative_alt = buf.get_i32_le()?;
31740 __struct.next_lat = buf.get_i32_le()?;
31741 __struct.next_lon = buf.get_i32_le()?;
31742 __struct.next_alt = buf.get_i32_le()?;
31743 __struct.vx = buf.get_i16_le()?;
31744 __struct.vy = buf.get_i16_le()?;
31745 __struct.vz = buf.get_i16_le()?;
31746 __struct.h_acc = buf.get_u16_le()?;
31747 __struct.v_acc = buf.get_u16_le()?;
31748 __struct.vel_acc = buf.get_u16_le()?;
31749 __struct.update_rate = buf.get_u16_le()?;
31750 for v in &mut __struct.uas_id {
31751 let val = buf.get_u8()?;
31752 *v = val;
31753 }
31754 let tmp = buf.get_u8()?;
31755 __struct.flight_state =
31756 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31757 enum_type: "UtmFlightState",
31758 value: tmp as u64,
31759 })?;
31760 let tmp = buf.get_u8()?;
31761 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
31762 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31763 flag_type: "UtmDataAvailFlags",
31764 value: tmp as u64,
31765 })?;
31766 Ok(__struct)
31767 }
31768 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31769 let mut __tmp = BytesMut::new(bytes);
31770 #[allow(clippy::absurd_extreme_comparisons)]
31771 #[allow(unused_comparisons)]
31772 if __tmp.remaining() < Self::ENCODED_LEN {
31773 panic!(
31774 "buffer is too small (need {} bytes, but got {})",
31775 Self::ENCODED_LEN,
31776 __tmp.remaining(),
31777 )
31778 }
31779 __tmp.put_u64_le(self.time);
31780 __tmp.put_i32_le(self.lat);
31781 __tmp.put_i32_le(self.lon);
31782 __tmp.put_i32_le(self.alt);
31783 __tmp.put_i32_le(self.relative_alt);
31784 __tmp.put_i32_le(self.next_lat);
31785 __tmp.put_i32_le(self.next_lon);
31786 __tmp.put_i32_le(self.next_alt);
31787 __tmp.put_i16_le(self.vx);
31788 __tmp.put_i16_le(self.vy);
31789 __tmp.put_i16_le(self.vz);
31790 __tmp.put_u16_le(self.h_acc);
31791 __tmp.put_u16_le(self.v_acc);
31792 __tmp.put_u16_le(self.vel_acc);
31793 __tmp.put_u16_le(self.update_rate);
31794 for val in &self.uas_id {
31795 __tmp.put_u8(*val);
31796 }
31797 __tmp.put_u8(self.flight_state as u8);
31798 __tmp.put_u8(self.flags.bits() as u8);
31799 if matches!(version, MavlinkVersion::V2) {
31800 let len = __tmp.len();
31801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31802 } else {
31803 __tmp.len()
31804 }
31805 }
31806}
31807#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31808#[doc = ""]
31809#[doc = "ID: 248"]
31810#[derive(Debug, Clone, PartialEq)]
31811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31813#[cfg_attr(feature = "ts", derive(TS))]
31814#[cfg_attr(feature = "ts", ts(export))]
31815pub struct V2_EXTENSION_DATA {
31816 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31817 pub message_type: u16,
31818 #[doc = "Network ID (0 for broadcast)"]
31819 pub target_network: u8,
31820 #[doc = "System ID (0 for broadcast)"]
31821 pub target_system: u8,
31822 #[doc = "Component ID (0 for broadcast)"]
31823 pub target_component: u8,
31824 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31825 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31826 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31827 pub payload: [u8; 249],
31828}
31829impl V2_EXTENSION_DATA {
31830 pub const ENCODED_LEN: usize = 254usize;
31831 pub const DEFAULT: Self = Self {
31832 message_type: 0_u16,
31833 target_network: 0_u8,
31834 target_system: 0_u8,
31835 target_component: 0_u8,
31836 payload: [0_u8; 249usize],
31837 };
31838 #[cfg(feature = "arbitrary")]
31839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31840 use arbitrary::{Arbitrary, Unstructured};
31841 let mut buf = [0u8; 1024];
31842 rng.fill_bytes(&mut buf);
31843 let mut unstructured = Unstructured::new(&buf);
31844 Self::arbitrary(&mut unstructured).unwrap_or_default()
31845 }
31846}
31847impl Default for V2_EXTENSION_DATA {
31848 fn default() -> Self {
31849 Self::DEFAULT.clone()
31850 }
31851}
31852impl MessageData for V2_EXTENSION_DATA {
31853 type Message = MavMessage;
31854 const ID: u32 = 248u32;
31855 const NAME: &'static str = "V2_EXTENSION";
31856 const EXTRA_CRC: u8 = 8u8;
31857 const ENCODED_LEN: usize = 254usize;
31858 fn deser(
31859 _version: MavlinkVersion,
31860 __input: &[u8],
31861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31862 let avail_len = __input.len();
31863 let mut payload_buf = [0; Self::ENCODED_LEN];
31864 let mut buf = if avail_len < Self::ENCODED_LEN {
31865 payload_buf[0..avail_len].copy_from_slice(__input);
31866 Bytes::new(&payload_buf)
31867 } else {
31868 Bytes::new(__input)
31869 };
31870 let mut __struct = Self::default();
31871 __struct.message_type = buf.get_u16_le()?;
31872 __struct.target_network = buf.get_u8()?;
31873 __struct.target_system = buf.get_u8()?;
31874 __struct.target_component = buf.get_u8()?;
31875 for v in &mut __struct.payload {
31876 let val = buf.get_u8()?;
31877 *v = val;
31878 }
31879 Ok(__struct)
31880 }
31881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31882 let mut __tmp = BytesMut::new(bytes);
31883 #[allow(clippy::absurd_extreme_comparisons)]
31884 #[allow(unused_comparisons)]
31885 if __tmp.remaining() < Self::ENCODED_LEN {
31886 panic!(
31887 "buffer is too small (need {} bytes, but got {})",
31888 Self::ENCODED_LEN,
31889 __tmp.remaining(),
31890 )
31891 }
31892 __tmp.put_u16_le(self.message_type);
31893 __tmp.put_u8(self.target_network);
31894 __tmp.put_u8(self.target_system);
31895 __tmp.put_u8(self.target_component);
31896 for val in &self.payload {
31897 __tmp.put_u8(*val);
31898 }
31899 if matches!(version, MavlinkVersion::V2) {
31900 let len = __tmp.len();
31901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31902 } else {
31903 __tmp.len()
31904 }
31905 }
31906}
31907#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31908#[doc = ""]
31909#[doc = "ID: 74"]
31910#[derive(Debug, Clone, PartialEq)]
31911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31913#[cfg_attr(feature = "ts", derive(TS))]
31914#[cfg_attr(feature = "ts", ts(export))]
31915pub struct VFR_HUD_DATA {
31916 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31917 pub airspeed: f32,
31918 #[doc = "Current ground speed."]
31919 pub groundspeed: f32,
31920 #[doc = "Current altitude (MSL)."]
31921 pub alt: f32,
31922 #[doc = "Current climb rate."]
31923 pub climb: f32,
31924 #[doc = "Current heading in compass units (0-360, 0=north)."]
31925 pub heading: i16,
31926 #[doc = "Current throttle setting (0 to 100)."]
31927 pub throttle: u16,
31928}
31929impl VFR_HUD_DATA {
31930 pub const ENCODED_LEN: usize = 20usize;
31931 pub const DEFAULT: Self = Self {
31932 airspeed: 0.0_f32,
31933 groundspeed: 0.0_f32,
31934 alt: 0.0_f32,
31935 climb: 0.0_f32,
31936 heading: 0_i16,
31937 throttle: 0_u16,
31938 };
31939 #[cfg(feature = "arbitrary")]
31940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31941 use arbitrary::{Arbitrary, Unstructured};
31942 let mut buf = [0u8; 1024];
31943 rng.fill_bytes(&mut buf);
31944 let mut unstructured = Unstructured::new(&buf);
31945 Self::arbitrary(&mut unstructured).unwrap_or_default()
31946 }
31947}
31948impl Default for VFR_HUD_DATA {
31949 fn default() -> Self {
31950 Self::DEFAULT.clone()
31951 }
31952}
31953impl MessageData for VFR_HUD_DATA {
31954 type Message = MavMessage;
31955 const ID: u32 = 74u32;
31956 const NAME: &'static str = "VFR_HUD";
31957 const EXTRA_CRC: u8 = 20u8;
31958 const ENCODED_LEN: usize = 20usize;
31959 fn deser(
31960 _version: MavlinkVersion,
31961 __input: &[u8],
31962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31963 let avail_len = __input.len();
31964 let mut payload_buf = [0; Self::ENCODED_LEN];
31965 let mut buf = if avail_len < Self::ENCODED_LEN {
31966 payload_buf[0..avail_len].copy_from_slice(__input);
31967 Bytes::new(&payload_buf)
31968 } else {
31969 Bytes::new(__input)
31970 };
31971 let mut __struct = Self::default();
31972 __struct.airspeed = buf.get_f32_le()?;
31973 __struct.groundspeed = buf.get_f32_le()?;
31974 __struct.alt = buf.get_f32_le()?;
31975 __struct.climb = buf.get_f32_le()?;
31976 __struct.heading = buf.get_i16_le()?;
31977 __struct.throttle = buf.get_u16_le()?;
31978 Ok(__struct)
31979 }
31980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31981 let mut __tmp = BytesMut::new(bytes);
31982 #[allow(clippy::absurd_extreme_comparisons)]
31983 #[allow(unused_comparisons)]
31984 if __tmp.remaining() < Self::ENCODED_LEN {
31985 panic!(
31986 "buffer is too small (need {} bytes, but got {})",
31987 Self::ENCODED_LEN,
31988 __tmp.remaining(),
31989 )
31990 }
31991 __tmp.put_f32_le(self.airspeed);
31992 __tmp.put_f32_le(self.groundspeed);
31993 __tmp.put_f32_le(self.alt);
31994 __tmp.put_f32_le(self.climb);
31995 __tmp.put_i16_le(self.heading);
31996 __tmp.put_u16_le(self.throttle);
31997 if matches!(version, MavlinkVersion::V2) {
31998 let len = __tmp.len();
31999 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32000 } else {
32001 __tmp.len()
32002 }
32003 }
32004}
32005#[doc = "Vibration levels and accelerometer clipping."]
32006#[doc = ""]
32007#[doc = "ID: 241"]
32008#[derive(Debug, Clone, PartialEq)]
32009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32011#[cfg_attr(feature = "ts", derive(TS))]
32012#[cfg_attr(feature = "ts", ts(export))]
32013pub struct VIBRATION_DATA {
32014 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32015 pub time_usec: u64,
32016 #[doc = "Vibration levels on X-axis"]
32017 pub vibration_x: f32,
32018 #[doc = "Vibration levels on Y-axis"]
32019 pub vibration_y: f32,
32020 #[doc = "Vibration levels on Z-axis"]
32021 pub vibration_z: f32,
32022 #[doc = "first accelerometer clipping count"]
32023 pub clipping_0: u32,
32024 #[doc = "second accelerometer clipping count"]
32025 pub clipping_1: u32,
32026 #[doc = "third accelerometer clipping count"]
32027 pub clipping_2: u32,
32028}
32029impl VIBRATION_DATA {
32030 pub const ENCODED_LEN: usize = 32usize;
32031 pub const DEFAULT: Self = Self {
32032 time_usec: 0_u64,
32033 vibration_x: 0.0_f32,
32034 vibration_y: 0.0_f32,
32035 vibration_z: 0.0_f32,
32036 clipping_0: 0_u32,
32037 clipping_1: 0_u32,
32038 clipping_2: 0_u32,
32039 };
32040 #[cfg(feature = "arbitrary")]
32041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32042 use arbitrary::{Arbitrary, Unstructured};
32043 let mut buf = [0u8; 1024];
32044 rng.fill_bytes(&mut buf);
32045 let mut unstructured = Unstructured::new(&buf);
32046 Self::arbitrary(&mut unstructured).unwrap_or_default()
32047 }
32048}
32049impl Default for VIBRATION_DATA {
32050 fn default() -> Self {
32051 Self::DEFAULT.clone()
32052 }
32053}
32054impl MessageData for VIBRATION_DATA {
32055 type Message = MavMessage;
32056 const ID: u32 = 241u32;
32057 const NAME: &'static str = "VIBRATION";
32058 const EXTRA_CRC: u8 = 90u8;
32059 const ENCODED_LEN: usize = 32usize;
32060 fn deser(
32061 _version: MavlinkVersion,
32062 __input: &[u8],
32063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32064 let avail_len = __input.len();
32065 let mut payload_buf = [0; Self::ENCODED_LEN];
32066 let mut buf = if avail_len < Self::ENCODED_LEN {
32067 payload_buf[0..avail_len].copy_from_slice(__input);
32068 Bytes::new(&payload_buf)
32069 } else {
32070 Bytes::new(__input)
32071 };
32072 let mut __struct = Self::default();
32073 __struct.time_usec = buf.get_u64_le()?;
32074 __struct.vibration_x = buf.get_f32_le()?;
32075 __struct.vibration_y = buf.get_f32_le()?;
32076 __struct.vibration_z = buf.get_f32_le()?;
32077 __struct.clipping_0 = buf.get_u32_le()?;
32078 __struct.clipping_1 = buf.get_u32_le()?;
32079 __struct.clipping_2 = buf.get_u32_le()?;
32080 Ok(__struct)
32081 }
32082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32083 let mut __tmp = BytesMut::new(bytes);
32084 #[allow(clippy::absurd_extreme_comparisons)]
32085 #[allow(unused_comparisons)]
32086 if __tmp.remaining() < Self::ENCODED_LEN {
32087 panic!(
32088 "buffer is too small (need {} bytes, but got {})",
32089 Self::ENCODED_LEN,
32090 __tmp.remaining(),
32091 )
32092 }
32093 __tmp.put_u64_le(self.time_usec);
32094 __tmp.put_f32_le(self.vibration_x);
32095 __tmp.put_f32_le(self.vibration_y);
32096 __tmp.put_f32_le(self.vibration_z);
32097 __tmp.put_u32_le(self.clipping_0);
32098 __tmp.put_u32_le(self.clipping_1);
32099 __tmp.put_u32_le(self.clipping_2);
32100 if matches!(version, MavlinkVersion::V2) {
32101 let len = __tmp.len();
32102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32103 } else {
32104 __tmp.len()
32105 }
32106 }
32107}
32108#[doc = "Global position estimate from a Vicon motion system source."]
32109#[doc = ""]
32110#[doc = "ID: 104"]
32111#[derive(Debug, Clone, PartialEq)]
32112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32114#[cfg_attr(feature = "ts", derive(TS))]
32115#[cfg_attr(feature = "ts", ts(export))]
32116pub struct VICON_POSITION_ESTIMATE_DATA {
32117 #[doc = "Timestamp (UNIX time or time since system boot)"]
32118 pub usec: u64,
32119 #[doc = "Global X position"]
32120 pub x: f32,
32121 #[doc = "Global Y position"]
32122 pub y: f32,
32123 #[doc = "Global Z position"]
32124 pub z: f32,
32125 #[doc = "Roll angle"]
32126 pub roll: f32,
32127 #[doc = "Pitch angle"]
32128 pub pitch: f32,
32129 #[doc = "Yaw angle"]
32130 pub yaw: f32,
32131 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32132 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32133 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32134 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32135 pub covariance: [f32; 21],
32136}
32137impl VICON_POSITION_ESTIMATE_DATA {
32138 pub const ENCODED_LEN: usize = 116usize;
32139 pub const DEFAULT: Self = Self {
32140 usec: 0_u64,
32141 x: 0.0_f32,
32142 y: 0.0_f32,
32143 z: 0.0_f32,
32144 roll: 0.0_f32,
32145 pitch: 0.0_f32,
32146 yaw: 0.0_f32,
32147 covariance: [0.0_f32; 21usize],
32148 };
32149 #[cfg(feature = "arbitrary")]
32150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32151 use arbitrary::{Arbitrary, Unstructured};
32152 let mut buf = [0u8; 1024];
32153 rng.fill_bytes(&mut buf);
32154 let mut unstructured = Unstructured::new(&buf);
32155 Self::arbitrary(&mut unstructured).unwrap_or_default()
32156 }
32157}
32158impl Default for VICON_POSITION_ESTIMATE_DATA {
32159 fn default() -> Self {
32160 Self::DEFAULT.clone()
32161 }
32162}
32163impl MessageData for VICON_POSITION_ESTIMATE_DATA {
32164 type Message = MavMessage;
32165 const ID: u32 = 104u32;
32166 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
32167 const EXTRA_CRC: u8 = 56u8;
32168 const ENCODED_LEN: usize = 116usize;
32169 fn deser(
32170 _version: MavlinkVersion,
32171 __input: &[u8],
32172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32173 let avail_len = __input.len();
32174 let mut payload_buf = [0; Self::ENCODED_LEN];
32175 let mut buf = if avail_len < Self::ENCODED_LEN {
32176 payload_buf[0..avail_len].copy_from_slice(__input);
32177 Bytes::new(&payload_buf)
32178 } else {
32179 Bytes::new(__input)
32180 };
32181 let mut __struct = Self::default();
32182 __struct.usec = buf.get_u64_le()?;
32183 __struct.x = buf.get_f32_le()?;
32184 __struct.y = buf.get_f32_le()?;
32185 __struct.z = buf.get_f32_le()?;
32186 __struct.roll = buf.get_f32_le()?;
32187 __struct.pitch = buf.get_f32_le()?;
32188 __struct.yaw = buf.get_f32_le()?;
32189 for v in &mut __struct.covariance {
32190 let val = buf.get_f32_le()?;
32191 *v = val;
32192 }
32193 Ok(__struct)
32194 }
32195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32196 let mut __tmp = BytesMut::new(bytes);
32197 #[allow(clippy::absurd_extreme_comparisons)]
32198 #[allow(unused_comparisons)]
32199 if __tmp.remaining() < Self::ENCODED_LEN {
32200 panic!(
32201 "buffer is too small (need {} bytes, but got {})",
32202 Self::ENCODED_LEN,
32203 __tmp.remaining(),
32204 )
32205 }
32206 __tmp.put_u64_le(self.usec);
32207 __tmp.put_f32_le(self.x);
32208 __tmp.put_f32_le(self.y);
32209 __tmp.put_f32_le(self.z);
32210 __tmp.put_f32_le(self.roll);
32211 __tmp.put_f32_le(self.pitch);
32212 __tmp.put_f32_le(self.yaw);
32213 if matches!(version, MavlinkVersion::V2) {
32214 for val in &self.covariance {
32215 __tmp.put_f32_le(*val);
32216 }
32217 let len = __tmp.len();
32218 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32219 } else {
32220 __tmp.len()
32221 }
32222 }
32223}
32224#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32225#[doc = ""]
32226#[doc = "ID: 269"]
32227#[derive(Debug, Clone, PartialEq)]
32228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32230#[cfg_attr(feature = "ts", derive(TS))]
32231#[cfg_attr(feature = "ts", ts(export))]
32232pub struct VIDEO_STREAM_INFORMATION_DATA {
32233 #[doc = "Frame rate."]
32234 pub framerate: f32,
32235 #[doc = "Bit rate."]
32236 pub bitrate: u32,
32237 #[doc = "Bitmap of stream status flags."]
32238 pub flags: VideoStreamStatusFlags,
32239 #[doc = "Horizontal resolution."]
32240 pub resolution_h: u16,
32241 #[doc = "Vertical resolution."]
32242 pub resolution_v: u16,
32243 #[doc = "Video image rotation clockwise."]
32244 pub rotation: u16,
32245 #[doc = "Horizontal Field of view."]
32246 pub hfov: u16,
32247 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32248 pub stream_id: u8,
32249 #[doc = "Number of streams available."]
32250 pub count: u8,
32251 #[doc = "Type of stream."]
32252 pub mavtype: VideoStreamType,
32253 #[doc = "Stream name."]
32254 #[cfg_attr(feature = "ts", ts(type = "string"))]
32255 pub name: CharArray<32>,
32256 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
32257 #[cfg_attr(feature = "ts", ts(type = "string"))]
32258 pub uri: CharArray<160>,
32259 #[doc = "Encoding of stream."]
32260 #[cfg_attr(feature = "serde", serde(default))]
32261 pub encoding: VideoStreamEncoding,
32262 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32263 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32264 pub camera_device_id: u8,
32265}
32266impl VIDEO_STREAM_INFORMATION_DATA {
32267 pub const ENCODED_LEN: usize = 215usize;
32268 pub const DEFAULT: Self = Self {
32269 framerate: 0.0_f32,
32270 bitrate: 0_u32,
32271 flags: VideoStreamStatusFlags::DEFAULT,
32272 resolution_h: 0_u16,
32273 resolution_v: 0_u16,
32274 rotation: 0_u16,
32275 hfov: 0_u16,
32276 stream_id: 0_u8,
32277 count: 0_u8,
32278 mavtype: VideoStreamType::DEFAULT,
32279 name: CharArray::new([0_u8; 32usize]),
32280 uri: CharArray::new([0_u8; 160usize]),
32281 encoding: VideoStreamEncoding::DEFAULT,
32282 camera_device_id: 0_u8,
32283 };
32284 #[cfg(feature = "arbitrary")]
32285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32286 use arbitrary::{Arbitrary, Unstructured};
32287 let mut buf = [0u8; 1024];
32288 rng.fill_bytes(&mut buf);
32289 let mut unstructured = Unstructured::new(&buf);
32290 Self::arbitrary(&mut unstructured).unwrap_or_default()
32291 }
32292}
32293impl Default for VIDEO_STREAM_INFORMATION_DATA {
32294 fn default() -> Self {
32295 Self::DEFAULT.clone()
32296 }
32297}
32298impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
32299 type Message = MavMessage;
32300 const ID: u32 = 269u32;
32301 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
32302 const EXTRA_CRC: u8 = 109u8;
32303 const ENCODED_LEN: usize = 215usize;
32304 fn deser(
32305 _version: MavlinkVersion,
32306 __input: &[u8],
32307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32308 let avail_len = __input.len();
32309 let mut payload_buf = [0; Self::ENCODED_LEN];
32310 let mut buf = if avail_len < Self::ENCODED_LEN {
32311 payload_buf[0..avail_len].copy_from_slice(__input);
32312 Bytes::new(&payload_buf)
32313 } else {
32314 Bytes::new(__input)
32315 };
32316 let mut __struct = Self::default();
32317 __struct.framerate = buf.get_f32_le()?;
32318 __struct.bitrate = buf.get_u32_le()?;
32319 let tmp = buf.get_u16_le()?;
32320 __struct.flags =
32321 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32322 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32323 flag_type: "VideoStreamStatusFlags",
32324 value: tmp as u64,
32325 })?;
32326 __struct.resolution_h = buf.get_u16_le()?;
32327 __struct.resolution_v = buf.get_u16_le()?;
32328 __struct.rotation = buf.get_u16_le()?;
32329 __struct.hfov = buf.get_u16_le()?;
32330 __struct.stream_id = buf.get_u8()?;
32331 __struct.count = buf.get_u8()?;
32332 let tmp = buf.get_u8()?;
32333 __struct.mavtype =
32334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32335 enum_type: "VideoStreamType",
32336 value: tmp as u64,
32337 })?;
32338 let mut tmp = [0_u8; 32usize];
32339 for v in &mut tmp {
32340 *v = buf.get_u8()?;
32341 }
32342 __struct.name = CharArray::new(tmp);
32343 let mut tmp = [0_u8; 160usize];
32344 for v in &mut tmp {
32345 *v = buf.get_u8()?;
32346 }
32347 __struct.uri = CharArray::new(tmp);
32348 let tmp = buf.get_u8()?;
32349 __struct.encoding =
32350 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32351 enum_type: "VideoStreamEncoding",
32352 value: tmp as u64,
32353 })?;
32354 __struct.camera_device_id = buf.get_u8()?;
32355 Ok(__struct)
32356 }
32357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32358 let mut __tmp = BytesMut::new(bytes);
32359 #[allow(clippy::absurd_extreme_comparisons)]
32360 #[allow(unused_comparisons)]
32361 if __tmp.remaining() < Self::ENCODED_LEN {
32362 panic!(
32363 "buffer is too small (need {} bytes, but got {})",
32364 Self::ENCODED_LEN,
32365 __tmp.remaining(),
32366 )
32367 }
32368 __tmp.put_f32_le(self.framerate);
32369 __tmp.put_u32_le(self.bitrate);
32370 __tmp.put_u16_le(self.flags.bits() as u16);
32371 __tmp.put_u16_le(self.resolution_h);
32372 __tmp.put_u16_le(self.resolution_v);
32373 __tmp.put_u16_le(self.rotation);
32374 __tmp.put_u16_le(self.hfov);
32375 __tmp.put_u8(self.stream_id);
32376 __tmp.put_u8(self.count);
32377 __tmp.put_u8(self.mavtype as u8);
32378 for val in &self.name {
32379 __tmp.put_u8(*val);
32380 }
32381 for val in &self.uri {
32382 __tmp.put_u8(*val);
32383 }
32384 if matches!(version, MavlinkVersion::V2) {
32385 __tmp.put_u8(self.encoding as u8);
32386 __tmp.put_u8(self.camera_device_id);
32387 let len = __tmp.len();
32388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32389 } else {
32390 __tmp.len()
32391 }
32392 }
32393}
32394#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32395#[doc = ""]
32396#[doc = "ID: 270"]
32397#[derive(Debug, Clone, PartialEq)]
32398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32400#[cfg_attr(feature = "ts", derive(TS))]
32401#[cfg_attr(feature = "ts", ts(export))]
32402pub struct VIDEO_STREAM_STATUS_DATA {
32403 #[doc = "Frame rate"]
32404 pub framerate: f32,
32405 #[doc = "Bit rate"]
32406 pub bitrate: u32,
32407 #[doc = "Bitmap of stream status flags"]
32408 pub flags: VideoStreamStatusFlags,
32409 #[doc = "Horizontal resolution"]
32410 pub resolution_h: u16,
32411 #[doc = "Vertical resolution"]
32412 pub resolution_v: u16,
32413 #[doc = "Video image rotation clockwise"]
32414 pub rotation: u16,
32415 #[doc = "Horizontal Field of view"]
32416 pub hfov: u16,
32417 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32418 pub stream_id: u8,
32419 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32420 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32421 pub camera_device_id: u8,
32422}
32423impl VIDEO_STREAM_STATUS_DATA {
32424 pub const ENCODED_LEN: usize = 20usize;
32425 pub const DEFAULT: Self = Self {
32426 framerate: 0.0_f32,
32427 bitrate: 0_u32,
32428 flags: VideoStreamStatusFlags::DEFAULT,
32429 resolution_h: 0_u16,
32430 resolution_v: 0_u16,
32431 rotation: 0_u16,
32432 hfov: 0_u16,
32433 stream_id: 0_u8,
32434 camera_device_id: 0_u8,
32435 };
32436 #[cfg(feature = "arbitrary")]
32437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32438 use arbitrary::{Arbitrary, Unstructured};
32439 let mut buf = [0u8; 1024];
32440 rng.fill_bytes(&mut buf);
32441 let mut unstructured = Unstructured::new(&buf);
32442 Self::arbitrary(&mut unstructured).unwrap_or_default()
32443 }
32444}
32445impl Default for VIDEO_STREAM_STATUS_DATA {
32446 fn default() -> Self {
32447 Self::DEFAULT.clone()
32448 }
32449}
32450impl MessageData for VIDEO_STREAM_STATUS_DATA {
32451 type Message = MavMessage;
32452 const ID: u32 = 270u32;
32453 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32454 const EXTRA_CRC: u8 = 59u8;
32455 const ENCODED_LEN: usize = 20usize;
32456 fn deser(
32457 _version: MavlinkVersion,
32458 __input: &[u8],
32459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32460 let avail_len = __input.len();
32461 let mut payload_buf = [0; Self::ENCODED_LEN];
32462 let mut buf = if avail_len < Self::ENCODED_LEN {
32463 payload_buf[0..avail_len].copy_from_slice(__input);
32464 Bytes::new(&payload_buf)
32465 } else {
32466 Bytes::new(__input)
32467 };
32468 let mut __struct = Self::default();
32469 __struct.framerate = buf.get_f32_le()?;
32470 __struct.bitrate = buf.get_u32_le()?;
32471 let tmp = buf.get_u16_le()?;
32472 __struct.flags =
32473 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32474 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32475 flag_type: "VideoStreamStatusFlags",
32476 value: tmp as u64,
32477 })?;
32478 __struct.resolution_h = buf.get_u16_le()?;
32479 __struct.resolution_v = buf.get_u16_le()?;
32480 __struct.rotation = buf.get_u16_le()?;
32481 __struct.hfov = buf.get_u16_le()?;
32482 __struct.stream_id = buf.get_u8()?;
32483 __struct.camera_device_id = buf.get_u8()?;
32484 Ok(__struct)
32485 }
32486 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32487 let mut __tmp = BytesMut::new(bytes);
32488 #[allow(clippy::absurd_extreme_comparisons)]
32489 #[allow(unused_comparisons)]
32490 if __tmp.remaining() < Self::ENCODED_LEN {
32491 panic!(
32492 "buffer is too small (need {} bytes, but got {})",
32493 Self::ENCODED_LEN,
32494 __tmp.remaining(),
32495 )
32496 }
32497 __tmp.put_f32_le(self.framerate);
32498 __tmp.put_u32_le(self.bitrate);
32499 __tmp.put_u16_le(self.flags.bits() as u16);
32500 __tmp.put_u16_le(self.resolution_h);
32501 __tmp.put_u16_le(self.resolution_v);
32502 __tmp.put_u16_le(self.rotation);
32503 __tmp.put_u16_le(self.hfov);
32504 __tmp.put_u8(self.stream_id);
32505 if matches!(version, MavlinkVersion::V2) {
32506 __tmp.put_u8(self.camera_device_id);
32507 let len = __tmp.len();
32508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32509 } else {
32510 __tmp.len()
32511 }
32512 }
32513}
32514#[doc = "Local position/attitude estimate from a vision source."]
32515#[doc = ""]
32516#[doc = "ID: 102"]
32517#[derive(Debug, Clone, PartialEq)]
32518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32520#[cfg_attr(feature = "ts", derive(TS))]
32521#[cfg_attr(feature = "ts", ts(export))]
32522pub struct VISION_POSITION_ESTIMATE_DATA {
32523 #[doc = "Timestamp (UNIX time or time since system boot)"]
32524 pub usec: u64,
32525 #[doc = "Local X position"]
32526 pub x: f32,
32527 #[doc = "Local Y position"]
32528 pub y: f32,
32529 #[doc = "Local Z position"]
32530 pub z: f32,
32531 #[doc = "Roll angle"]
32532 pub roll: f32,
32533 #[doc = "Pitch angle"]
32534 pub pitch: f32,
32535 #[doc = "Yaw angle"]
32536 pub yaw: f32,
32537 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32538 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32540 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32541 pub covariance: [f32; 21],
32542 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32544 pub reset_counter: u8,
32545}
32546impl VISION_POSITION_ESTIMATE_DATA {
32547 pub const ENCODED_LEN: usize = 117usize;
32548 pub const DEFAULT: Self = Self {
32549 usec: 0_u64,
32550 x: 0.0_f32,
32551 y: 0.0_f32,
32552 z: 0.0_f32,
32553 roll: 0.0_f32,
32554 pitch: 0.0_f32,
32555 yaw: 0.0_f32,
32556 covariance: [0.0_f32; 21usize],
32557 reset_counter: 0_u8,
32558 };
32559 #[cfg(feature = "arbitrary")]
32560 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32561 use arbitrary::{Arbitrary, Unstructured};
32562 let mut buf = [0u8; 1024];
32563 rng.fill_bytes(&mut buf);
32564 let mut unstructured = Unstructured::new(&buf);
32565 Self::arbitrary(&mut unstructured).unwrap_or_default()
32566 }
32567}
32568impl Default for VISION_POSITION_ESTIMATE_DATA {
32569 fn default() -> Self {
32570 Self::DEFAULT.clone()
32571 }
32572}
32573impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32574 type Message = MavMessage;
32575 const ID: u32 = 102u32;
32576 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32577 const EXTRA_CRC: u8 = 158u8;
32578 const ENCODED_LEN: usize = 117usize;
32579 fn deser(
32580 _version: MavlinkVersion,
32581 __input: &[u8],
32582 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32583 let avail_len = __input.len();
32584 let mut payload_buf = [0; Self::ENCODED_LEN];
32585 let mut buf = if avail_len < Self::ENCODED_LEN {
32586 payload_buf[0..avail_len].copy_from_slice(__input);
32587 Bytes::new(&payload_buf)
32588 } else {
32589 Bytes::new(__input)
32590 };
32591 let mut __struct = Self::default();
32592 __struct.usec = buf.get_u64_le()?;
32593 __struct.x = buf.get_f32_le()?;
32594 __struct.y = buf.get_f32_le()?;
32595 __struct.z = buf.get_f32_le()?;
32596 __struct.roll = buf.get_f32_le()?;
32597 __struct.pitch = buf.get_f32_le()?;
32598 __struct.yaw = buf.get_f32_le()?;
32599 for v in &mut __struct.covariance {
32600 let val = buf.get_f32_le()?;
32601 *v = val;
32602 }
32603 __struct.reset_counter = buf.get_u8()?;
32604 Ok(__struct)
32605 }
32606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32607 let mut __tmp = BytesMut::new(bytes);
32608 #[allow(clippy::absurd_extreme_comparisons)]
32609 #[allow(unused_comparisons)]
32610 if __tmp.remaining() < Self::ENCODED_LEN {
32611 panic!(
32612 "buffer is too small (need {} bytes, but got {})",
32613 Self::ENCODED_LEN,
32614 __tmp.remaining(),
32615 )
32616 }
32617 __tmp.put_u64_le(self.usec);
32618 __tmp.put_f32_le(self.x);
32619 __tmp.put_f32_le(self.y);
32620 __tmp.put_f32_le(self.z);
32621 __tmp.put_f32_le(self.roll);
32622 __tmp.put_f32_le(self.pitch);
32623 __tmp.put_f32_le(self.yaw);
32624 if matches!(version, MavlinkVersion::V2) {
32625 for val in &self.covariance {
32626 __tmp.put_f32_le(*val);
32627 }
32628 __tmp.put_u8(self.reset_counter);
32629 let len = __tmp.len();
32630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32631 } else {
32632 __tmp.len()
32633 }
32634 }
32635}
32636#[doc = "Speed estimate from a vision source."]
32637#[doc = ""]
32638#[doc = "ID: 103"]
32639#[derive(Debug, Clone, PartialEq)]
32640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32642#[cfg_attr(feature = "ts", derive(TS))]
32643#[cfg_attr(feature = "ts", ts(export))]
32644pub struct VISION_SPEED_ESTIMATE_DATA {
32645 #[doc = "Timestamp (UNIX time or time since system boot)"]
32646 pub usec: u64,
32647 #[doc = "Global X speed"]
32648 pub x: f32,
32649 #[doc = "Global Y speed"]
32650 pub y: f32,
32651 #[doc = "Global Z speed"]
32652 pub z: f32,
32653 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32656 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32657 pub covariance: [f32; 9],
32658 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32660 pub reset_counter: u8,
32661}
32662impl VISION_SPEED_ESTIMATE_DATA {
32663 pub const ENCODED_LEN: usize = 57usize;
32664 pub const DEFAULT: Self = Self {
32665 usec: 0_u64,
32666 x: 0.0_f32,
32667 y: 0.0_f32,
32668 z: 0.0_f32,
32669 covariance: [0.0_f32; 9usize],
32670 reset_counter: 0_u8,
32671 };
32672 #[cfg(feature = "arbitrary")]
32673 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32674 use arbitrary::{Arbitrary, Unstructured};
32675 let mut buf = [0u8; 1024];
32676 rng.fill_bytes(&mut buf);
32677 let mut unstructured = Unstructured::new(&buf);
32678 Self::arbitrary(&mut unstructured).unwrap_or_default()
32679 }
32680}
32681impl Default for VISION_SPEED_ESTIMATE_DATA {
32682 fn default() -> Self {
32683 Self::DEFAULT.clone()
32684 }
32685}
32686impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32687 type Message = MavMessage;
32688 const ID: u32 = 103u32;
32689 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32690 const EXTRA_CRC: u8 = 208u8;
32691 const ENCODED_LEN: usize = 57usize;
32692 fn deser(
32693 _version: MavlinkVersion,
32694 __input: &[u8],
32695 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32696 let avail_len = __input.len();
32697 let mut payload_buf = [0; Self::ENCODED_LEN];
32698 let mut buf = if avail_len < Self::ENCODED_LEN {
32699 payload_buf[0..avail_len].copy_from_slice(__input);
32700 Bytes::new(&payload_buf)
32701 } else {
32702 Bytes::new(__input)
32703 };
32704 let mut __struct = Self::default();
32705 __struct.usec = buf.get_u64_le()?;
32706 __struct.x = buf.get_f32_le()?;
32707 __struct.y = buf.get_f32_le()?;
32708 __struct.z = buf.get_f32_le()?;
32709 for v in &mut __struct.covariance {
32710 let val = buf.get_f32_le()?;
32711 *v = val;
32712 }
32713 __struct.reset_counter = buf.get_u8()?;
32714 Ok(__struct)
32715 }
32716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32717 let mut __tmp = BytesMut::new(bytes);
32718 #[allow(clippy::absurd_extreme_comparisons)]
32719 #[allow(unused_comparisons)]
32720 if __tmp.remaining() < Self::ENCODED_LEN {
32721 panic!(
32722 "buffer is too small (need {} bytes, but got {})",
32723 Self::ENCODED_LEN,
32724 __tmp.remaining(),
32725 )
32726 }
32727 __tmp.put_u64_le(self.usec);
32728 __tmp.put_f32_le(self.x);
32729 __tmp.put_f32_le(self.y);
32730 __tmp.put_f32_le(self.z);
32731 if matches!(version, MavlinkVersion::V2) {
32732 for val in &self.covariance {
32733 __tmp.put_f32_le(*val);
32734 }
32735 __tmp.put_u8(self.reset_counter);
32736 let len = __tmp.len();
32737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32738 } else {
32739 __tmp.len()
32740 }
32741 }
32742}
32743#[doc = "Cumulative distance traveled for each reported wheel."]
32744#[doc = ""]
32745#[doc = "ID: 9000"]
32746#[derive(Debug, Clone, PartialEq)]
32747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32749#[cfg_attr(feature = "ts", derive(TS))]
32750#[cfg_attr(feature = "ts", ts(export))]
32751pub struct WHEEL_DISTANCE_DATA {
32752 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32753 pub time_usec: u64,
32754 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32755 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32756 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32757 pub distance: [f64; 16],
32758 #[doc = "Number of wheels reported."]
32759 pub count: u8,
32760}
32761impl WHEEL_DISTANCE_DATA {
32762 pub const ENCODED_LEN: usize = 137usize;
32763 pub const DEFAULT: Self = Self {
32764 time_usec: 0_u64,
32765 distance: [0.0_f64; 16usize],
32766 count: 0_u8,
32767 };
32768 #[cfg(feature = "arbitrary")]
32769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32770 use arbitrary::{Arbitrary, Unstructured};
32771 let mut buf = [0u8; 1024];
32772 rng.fill_bytes(&mut buf);
32773 let mut unstructured = Unstructured::new(&buf);
32774 Self::arbitrary(&mut unstructured).unwrap_or_default()
32775 }
32776}
32777impl Default for WHEEL_DISTANCE_DATA {
32778 fn default() -> Self {
32779 Self::DEFAULT.clone()
32780 }
32781}
32782impl MessageData for WHEEL_DISTANCE_DATA {
32783 type Message = MavMessage;
32784 const ID: u32 = 9000u32;
32785 const NAME: &'static str = "WHEEL_DISTANCE";
32786 const EXTRA_CRC: u8 = 113u8;
32787 const ENCODED_LEN: usize = 137usize;
32788 fn deser(
32789 _version: MavlinkVersion,
32790 __input: &[u8],
32791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32792 let avail_len = __input.len();
32793 let mut payload_buf = [0; Self::ENCODED_LEN];
32794 let mut buf = if avail_len < Self::ENCODED_LEN {
32795 payload_buf[0..avail_len].copy_from_slice(__input);
32796 Bytes::new(&payload_buf)
32797 } else {
32798 Bytes::new(__input)
32799 };
32800 let mut __struct = Self::default();
32801 __struct.time_usec = buf.get_u64_le()?;
32802 for v in &mut __struct.distance {
32803 let val = buf.get_f64_le()?;
32804 *v = val;
32805 }
32806 __struct.count = buf.get_u8()?;
32807 Ok(__struct)
32808 }
32809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32810 let mut __tmp = BytesMut::new(bytes);
32811 #[allow(clippy::absurd_extreme_comparisons)]
32812 #[allow(unused_comparisons)]
32813 if __tmp.remaining() < Self::ENCODED_LEN {
32814 panic!(
32815 "buffer is too small (need {} bytes, but got {})",
32816 Self::ENCODED_LEN,
32817 __tmp.remaining(),
32818 )
32819 }
32820 __tmp.put_u64_le(self.time_usec);
32821 for val in &self.distance {
32822 __tmp.put_f64_le(*val);
32823 }
32824 __tmp.put_u8(self.count);
32825 if matches!(version, MavlinkVersion::V2) {
32826 let len = __tmp.len();
32827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32828 } else {
32829 __tmp.len()
32830 }
32831 }
32832}
32833#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32834#[doc = ""]
32835#[doc = "ID: 299"]
32836#[derive(Debug, Clone, PartialEq)]
32837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32839#[cfg_attr(feature = "ts", derive(TS))]
32840#[cfg_attr(feature = "ts", ts(export))]
32841pub struct WIFI_CONFIG_AP_DATA {
32842 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32843 #[cfg_attr(feature = "ts", ts(type = "string"))]
32844 pub ssid: CharArray<32>,
32845 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32846 #[cfg_attr(feature = "ts", ts(type = "string"))]
32847 pub password: CharArray<64>,
32848 #[doc = "WiFi Mode."]
32849 #[cfg_attr(feature = "serde", serde(default))]
32850 pub mode: WifiConfigApMode,
32851 #[doc = "Message acceptance response (sent back to GS)."]
32852 #[cfg_attr(feature = "serde", serde(default))]
32853 pub response: WifiConfigApResponse,
32854}
32855impl WIFI_CONFIG_AP_DATA {
32856 pub const ENCODED_LEN: usize = 98usize;
32857 pub const DEFAULT: Self = Self {
32858 ssid: CharArray::new([0_u8; 32usize]),
32859 password: CharArray::new([0_u8; 64usize]),
32860 mode: WifiConfigApMode::DEFAULT,
32861 response: WifiConfigApResponse::DEFAULT,
32862 };
32863 #[cfg(feature = "arbitrary")]
32864 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32865 use arbitrary::{Arbitrary, Unstructured};
32866 let mut buf = [0u8; 1024];
32867 rng.fill_bytes(&mut buf);
32868 let mut unstructured = Unstructured::new(&buf);
32869 Self::arbitrary(&mut unstructured).unwrap_or_default()
32870 }
32871}
32872impl Default for WIFI_CONFIG_AP_DATA {
32873 fn default() -> Self {
32874 Self::DEFAULT.clone()
32875 }
32876}
32877impl MessageData for WIFI_CONFIG_AP_DATA {
32878 type Message = MavMessage;
32879 const ID: u32 = 299u32;
32880 const NAME: &'static str = "WIFI_CONFIG_AP";
32881 const EXTRA_CRC: u8 = 19u8;
32882 const ENCODED_LEN: usize = 98usize;
32883 fn deser(
32884 _version: MavlinkVersion,
32885 __input: &[u8],
32886 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32887 let avail_len = __input.len();
32888 let mut payload_buf = [0; Self::ENCODED_LEN];
32889 let mut buf = if avail_len < Self::ENCODED_LEN {
32890 payload_buf[0..avail_len].copy_from_slice(__input);
32891 Bytes::new(&payload_buf)
32892 } else {
32893 Bytes::new(__input)
32894 };
32895 let mut __struct = Self::default();
32896 let mut tmp = [0_u8; 32usize];
32897 for v in &mut tmp {
32898 *v = buf.get_u8()?;
32899 }
32900 __struct.ssid = CharArray::new(tmp);
32901 let mut tmp = [0_u8; 64usize];
32902 for v in &mut tmp {
32903 *v = buf.get_u8()?;
32904 }
32905 __struct.password = CharArray::new(tmp);
32906 let tmp = buf.get_i8()?;
32907 __struct.mode =
32908 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32909 enum_type: "WifiConfigApMode",
32910 value: tmp as u64,
32911 })?;
32912 let tmp = buf.get_i8()?;
32913 __struct.response =
32914 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32915 enum_type: "WifiConfigApResponse",
32916 value: tmp as u64,
32917 })?;
32918 Ok(__struct)
32919 }
32920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32921 let mut __tmp = BytesMut::new(bytes);
32922 #[allow(clippy::absurd_extreme_comparisons)]
32923 #[allow(unused_comparisons)]
32924 if __tmp.remaining() < Self::ENCODED_LEN {
32925 panic!(
32926 "buffer is too small (need {} bytes, but got {})",
32927 Self::ENCODED_LEN,
32928 __tmp.remaining(),
32929 )
32930 }
32931 for val in &self.ssid {
32932 __tmp.put_u8(*val);
32933 }
32934 for val in &self.password {
32935 __tmp.put_u8(*val);
32936 }
32937 if matches!(version, MavlinkVersion::V2) {
32938 __tmp.put_i8(self.mode as i8);
32939 __tmp.put_i8(self.response as i8);
32940 let len = __tmp.len();
32941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32942 } else {
32943 __tmp.len()
32944 }
32945 }
32946}
32947#[doc = "Winch status."]
32948#[doc = ""]
32949#[doc = "ID: 9005"]
32950#[derive(Debug, Clone, PartialEq)]
32951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32952#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32953#[cfg_attr(feature = "ts", derive(TS))]
32954#[cfg_attr(feature = "ts", ts(export))]
32955pub struct WINCH_STATUS_DATA {
32956 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32957 pub time_usec: u64,
32958 #[doc = "Length of line released. NaN if unknown"]
32959 pub line_length: f32,
32960 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32961 pub speed: f32,
32962 #[doc = "Tension on the line. NaN if unknown"]
32963 pub tension: f32,
32964 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32965 pub voltage: f32,
32966 #[doc = "Current draw from the winch. NaN if unknown"]
32967 pub current: f32,
32968 #[doc = "Status flags"]
32969 pub status: MavWinchStatusFlag,
32970 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32971 pub temperature: i16,
32972}
32973impl WINCH_STATUS_DATA {
32974 pub const ENCODED_LEN: usize = 34usize;
32975 pub const DEFAULT: Self = Self {
32976 time_usec: 0_u64,
32977 line_length: 0.0_f32,
32978 speed: 0.0_f32,
32979 tension: 0.0_f32,
32980 voltage: 0.0_f32,
32981 current: 0.0_f32,
32982 status: MavWinchStatusFlag::DEFAULT,
32983 temperature: 0_i16,
32984 };
32985 #[cfg(feature = "arbitrary")]
32986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32987 use arbitrary::{Arbitrary, Unstructured};
32988 let mut buf = [0u8; 1024];
32989 rng.fill_bytes(&mut buf);
32990 let mut unstructured = Unstructured::new(&buf);
32991 Self::arbitrary(&mut unstructured).unwrap_or_default()
32992 }
32993}
32994impl Default for WINCH_STATUS_DATA {
32995 fn default() -> Self {
32996 Self::DEFAULT.clone()
32997 }
32998}
32999impl MessageData for WINCH_STATUS_DATA {
33000 type Message = MavMessage;
33001 const ID: u32 = 9005u32;
33002 const NAME: &'static str = "WINCH_STATUS";
33003 const EXTRA_CRC: u8 = 117u8;
33004 const ENCODED_LEN: usize = 34usize;
33005 fn deser(
33006 _version: MavlinkVersion,
33007 __input: &[u8],
33008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33009 let avail_len = __input.len();
33010 let mut payload_buf = [0; Self::ENCODED_LEN];
33011 let mut buf = if avail_len < Self::ENCODED_LEN {
33012 payload_buf[0..avail_len].copy_from_slice(__input);
33013 Bytes::new(&payload_buf)
33014 } else {
33015 Bytes::new(__input)
33016 };
33017 let mut __struct = Self::default();
33018 __struct.time_usec = buf.get_u64_le()?;
33019 __struct.line_length = buf.get_f32_le()?;
33020 __struct.speed = buf.get_f32_le()?;
33021 __struct.tension = buf.get_f32_le()?;
33022 __struct.voltage = buf.get_f32_le()?;
33023 __struct.current = buf.get_f32_le()?;
33024 let tmp = buf.get_u32_le()?;
33025 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
33026 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
33027 flag_type: "MavWinchStatusFlag",
33028 value: tmp as u64,
33029 })?;
33030 __struct.temperature = buf.get_i16_le()?;
33031 Ok(__struct)
33032 }
33033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33034 let mut __tmp = BytesMut::new(bytes);
33035 #[allow(clippy::absurd_extreme_comparisons)]
33036 #[allow(unused_comparisons)]
33037 if __tmp.remaining() < Self::ENCODED_LEN {
33038 panic!(
33039 "buffer is too small (need {} bytes, but got {})",
33040 Self::ENCODED_LEN,
33041 __tmp.remaining(),
33042 )
33043 }
33044 __tmp.put_u64_le(self.time_usec);
33045 __tmp.put_f32_le(self.line_length);
33046 __tmp.put_f32_le(self.speed);
33047 __tmp.put_f32_le(self.tension);
33048 __tmp.put_f32_le(self.voltage);
33049 __tmp.put_f32_le(self.current);
33050 __tmp.put_u32_le(self.status.bits() as u32);
33051 __tmp.put_i16_le(self.temperature);
33052 if matches!(version, MavlinkVersion::V2) {
33053 let len = __tmp.len();
33054 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33055 } else {
33056 __tmp.len()
33057 }
33058 }
33059}
33060#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33061#[doc = ""]
33062#[doc = "ID: 231"]
33063#[derive(Debug, Clone, PartialEq)]
33064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33066#[cfg_attr(feature = "ts", derive(TS))]
33067#[cfg_attr(feature = "ts", ts(export))]
33068pub struct WIND_COV_DATA {
33069 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
33070 pub time_usec: u64,
33071 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
33072 pub wind_x: f32,
33073 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
33074 pub wind_y: f32,
33075 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
33076 pub wind_z: f32,
33077 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
33078 pub var_horiz: f32,
33079 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
33080 pub var_vert: f32,
33081 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
33082 pub wind_alt: f32,
33083 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
33084 pub horiz_accuracy: f32,
33085 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
33086 pub vert_accuracy: f32,
33087}
33088impl WIND_COV_DATA {
33089 pub const ENCODED_LEN: usize = 40usize;
33090 pub const DEFAULT: Self = Self {
33091 time_usec: 0_u64,
33092 wind_x: 0.0_f32,
33093 wind_y: 0.0_f32,
33094 wind_z: 0.0_f32,
33095 var_horiz: 0.0_f32,
33096 var_vert: 0.0_f32,
33097 wind_alt: 0.0_f32,
33098 horiz_accuracy: 0.0_f32,
33099 vert_accuracy: 0.0_f32,
33100 };
33101 #[cfg(feature = "arbitrary")]
33102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
33103 use arbitrary::{Arbitrary, Unstructured};
33104 let mut buf = [0u8; 1024];
33105 rng.fill_bytes(&mut buf);
33106 let mut unstructured = Unstructured::new(&buf);
33107 Self::arbitrary(&mut unstructured).unwrap_or_default()
33108 }
33109}
33110impl Default for WIND_COV_DATA {
33111 fn default() -> Self {
33112 Self::DEFAULT.clone()
33113 }
33114}
33115impl MessageData for WIND_COV_DATA {
33116 type Message = MavMessage;
33117 const ID: u32 = 231u32;
33118 const NAME: &'static str = "WIND_COV";
33119 const EXTRA_CRC: u8 = 105u8;
33120 const ENCODED_LEN: usize = 40usize;
33121 fn deser(
33122 _version: MavlinkVersion,
33123 __input: &[u8],
33124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33125 let avail_len = __input.len();
33126 let mut payload_buf = [0; Self::ENCODED_LEN];
33127 let mut buf = if avail_len < Self::ENCODED_LEN {
33128 payload_buf[0..avail_len].copy_from_slice(__input);
33129 Bytes::new(&payload_buf)
33130 } else {
33131 Bytes::new(__input)
33132 };
33133 let mut __struct = Self::default();
33134 __struct.time_usec = buf.get_u64_le()?;
33135 __struct.wind_x = buf.get_f32_le()?;
33136 __struct.wind_y = buf.get_f32_le()?;
33137 __struct.wind_z = buf.get_f32_le()?;
33138 __struct.var_horiz = buf.get_f32_le()?;
33139 __struct.var_vert = buf.get_f32_le()?;
33140 __struct.wind_alt = buf.get_f32_le()?;
33141 __struct.horiz_accuracy = buf.get_f32_le()?;
33142 __struct.vert_accuracy = buf.get_f32_le()?;
33143 Ok(__struct)
33144 }
33145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33146 let mut __tmp = BytesMut::new(bytes);
33147 #[allow(clippy::absurd_extreme_comparisons)]
33148 #[allow(unused_comparisons)]
33149 if __tmp.remaining() < Self::ENCODED_LEN {
33150 panic!(
33151 "buffer is too small (need {} bytes, but got {})",
33152 Self::ENCODED_LEN,
33153 __tmp.remaining(),
33154 )
33155 }
33156 __tmp.put_u64_le(self.time_usec);
33157 __tmp.put_f32_le(self.wind_x);
33158 __tmp.put_f32_le(self.wind_y);
33159 __tmp.put_f32_le(self.wind_z);
33160 __tmp.put_f32_le(self.var_horiz);
33161 __tmp.put_f32_le(self.var_vert);
33162 __tmp.put_f32_le(self.wind_alt);
33163 __tmp.put_f32_le(self.horiz_accuracy);
33164 __tmp.put_f32_le(self.vert_accuracy);
33165 if matches!(version, MavlinkVersion::V2) {
33166 let len = __tmp.len();
33167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33168 } else {
33169 __tmp.len()
33170 }
33171 }
33172}
33173#[derive(Clone, PartialEq, Debug)]
33174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33175#[cfg_attr(feature = "serde", serde(tag = "type"))]
33176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33177#[cfg_attr(feature = "ts", derive(TS))]
33178#[cfg_attr(feature = "ts", ts(export))]
33179#[repr(u32)]
33180pub enum MavMessage {
33181 #[doc = "Set the vehicle attitude and body angular rates."]
33182 #[doc = ""]
33183 #[doc = "ID: 140"]
33184 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
33185 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
33186 #[doc = ""]
33187 #[doc = "ID: 375"]
33188 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
33189 #[doc = "The location and information of an ADSB vehicle."]
33190 #[doc = ""]
33191 #[doc = "ID: 246"]
33192 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
33193 #[doc = "The location and information of an AIS vessel."]
33194 #[doc = ""]
33195 #[doc = "ID: 301"]
33196 AIS_VESSEL(AIS_VESSEL_DATA),
33197 #[doc = "The current system altitude."]
33198 #[doc = ""]
33199 #[doc = "ID: 141"]
33200 ALTITUDE(ALTITUDE_DATA),
33201 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
33202 #[doc = ""]
33203 #[doc = "ID: 30"]
33204 ATTITUDE(ATTITUDE_DATA),
33205 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33206 #[doc = ""]
33207 #[doc = "ID: 31"]
33208 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
33209 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33210 #[doc = ""]
33211 #[doc = "ID: 61"]
33212 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
33213 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
33214 #[doc = ""]
33215 #[doc = "ID: 83"]
33216 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
33217 #[doc = "Motion capture attitude and position."]
33218 #[doc = ""]
33219 #[doc = "ID: 138"]
33220 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
33221 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
33222 #[doc = ""]
33223 #[doc = "ID: 7"]
33224 AUTH_KEY(AUTH_KEY_DATA),
33225 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
33226 #[doc = ""]
33227 #[doc = "ID: 286"]
33228 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
33229 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
33230 #[doc = ""]
33231 #[doc = "ID: 148"]
33232 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
33233 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
33234 #[doc = ""]
33235 #[doc = "ID: 435"]
33236 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
33237 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
33238 #[doc = ""]
33239 #[doc = "ID: 437"]
33240 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
33241 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
33242 #[doc = ""]
33243 #[doc = "ID: 372"]
33244 BATTERY_INFO(BATTERY_INFO_DATA),
33245 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
33246 #[doc = ""]
33247 #[doc = "ID: 147"]
33248 BATTERY_STATUS(BATTERY_STATUS_DATA),
33249 #[doc = "Report button state change."]
33250 #[doc = ""]
33251 #[doc = "ID: 257"]
33252 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33253 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33254 #[doc = ""]
33255 #[doc = "ID: 262"]
33256 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33257 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33258 #[doc = ""]
33259 #[doc = "ID: 271"]
33260 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33261 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
33262 #[doc = ""]
33263 #[doc = "ID: 263"]
33264 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33265 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33266 #[doc = ""]
33267 #[doc = "ID: 259"]
33268 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33269 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33270 #[doc = ""]
33271 #[doc = "ID: 260"]
33272 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33273 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
33274 #[doc = ""]
33275 #[doc = "ID: 277"]
33276 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33277 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33278 #[doc = ""]
33279 #[doc = "ID: 276"]
33280 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33281 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33282 #[doc = ""]
33283 #[doc = "ID: 275"]
33284 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33285 #[doc = "Camera-IMU triggering and synchronisation message."]
33286 #[doc = ""]
33287 #[doc = "ID: 112"]
33288 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33289 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
33290 #[doc = ""]
33291 #[doc = "ID: 387"]
33292 CANFD_FRAME(CANFD_FRAME_DATA),
33293 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
33294 #[doc = ""]
33295 #[doc = "ID: 388"]
33296 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33297 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
33298 #[doc = ""]
33299 #[doc = "ID: 386"]
33300 CAN_FRAME(CAN_FRAME_DATA),
33301 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33302 #[doc = ""]
33303 #[doc = "ID: 336"]
33304 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33305 #[doc = "Report current used cellular network status."]
33306 #[doc = ""]
33307 #[doc = "ID: 334"]
33308 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33309 #[doc = "Request to control this MAV."]
33310 #[doc = ""]
33311 #[doc = "ID: 5"]
33312 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33313 #[doc = "Accept / deny control of this MAV."]
33314 #[doc = ""]
33315 #[doc = "ID: 6"]
33316 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33317 #[doc = "Information about a potential collision."]
33318 #[doc = ""]
33319 #[doc = "ID: 247"]
33320 COLLISION(COLLISION_DATA),
33321 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33322 #[doc = ""]
33323 #[doc = "ID: 77"]
33324 COMMAND_ACK(COMMAND_ACK_DATA),
33325 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33326 #[doc = ""]
33327 #[doc = "ID: 80"]
33328 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33329 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33330 #[doc = ""]
33331 #[doc = "ID: 75"]
33332 COMMAND_INT(COMMAND_INT_DATA),
33333 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33334 #[doc = ""]
33335 #[doc = "ID: 76"]
33336 COMMAND_LONG(COMMAND_LONG_DATA),
33337 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
33338 #[doc = ""]
33339 #[doc = "ID: 395"]
33340 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33341 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33342 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
33343 #[doc = ""]
33344 #[doc = "ID: 396"]
33345 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33346 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
33347 #[doc = ""]
33348 #[doc = "ID: 397"]
33349 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33350 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
33351 #[doc = ""]
33352 #[doc = "ID: 146"]
33353 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33354 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
33355 #[doc = ""]
33356 #[doc = "ID: 411"]
33357 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33358 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33359 #[doc = ""]
33360 #[doc = "ID: 436"]
33361 CURRENT_MODE(CURRENT_MODE_DATA),
33362 #[doc = "Data stream status information."]
33363 #[doc = ""]
33364 #[doc = "ID: 67"]
33365 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33366 DATA_STREAM(DATA_STREAM_DATA),
33367 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33368 #[doc = ""]
33369 #[doc = "ID: 130"]
33370 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33371 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33372 #[doc = ""]
33373 #[doc = "ID: 254"]
33374 DEBUG(DEBUG_DATA),
33375 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33376 #[doc = ""]
33377 #[doc = "ID: 350"]
33378 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33379 #[doc = "To debug something using a named 3D vector."]
33380 #[doc = ""]
33381 #[doc = "ID: 250"]
33382 DEBUG_VECT(DEBUG_VECT_DATA),
33383 #[doc = "Distance sensor information for an onboard rangefinder."]
33384 #[doc = ""]
33385 #[doc = "ID: 132"]
33386 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33387 #[doc = "EFI status output."]
33388 #[doc = ""]
33389 #[doc = "ID: 225"]
33390 EFI_STATUS(EFI_STATUS_DATA),
33391 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33392 #[doc = ""]
33393 #[doc = "ID: 131"]
33394 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33395 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33396 #[doc = ""]
33397 #[doc = "ID: 290"]
33398 ESC_INFO(ESC_INFO_DATA),
33399 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33400 #[doc = ""]
33401 #[doc = "ID: 291"]
33402 ESC_STATUS(ESC_STATUS_DATA),
33403 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33404 #[doc = ""]
33405 #[doc = "ID: 230"]
33406 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33407 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33408 #[doc = ""]
33409 #[doc = "ID: 410"]
33410 EVENT(EVENT_DATA),
33411 #[doc = "Provides state for additional features."]
33412 #[doc = ""]
33413 #[doc = "ID: 245"]
33414 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33415 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33416 #[doc = ""]
33417 #[doc = "ID: 162"]
33418 FENCE_STATUS(FENCE_STATUS_DATA),
33419 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33420 #[doc = ""]
33421 #[doc = "ID: 110"]
33422 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33423 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33424 #[doc = ""]
33425 #[doc = "ID: 264"]
33426 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33427 #[doc = "Current motion information from a designated system."]
33428 #[doc = ""]
33429 #[doc = "ID: 144"]
33430 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33431 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33432 #[doc = ""]
33433 #[doc = "ID: 371"]
33434 FUEL_STATUS(FUEL_STATUS_DATA),
33435 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33436 #[doc = ""]
33437 #[doc = "ID: 373"]
33438 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33439 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33440 #[doc = ""]
33441 #[doc = "ID: 285"]
33442 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33443 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33444 #[doc = ""]
33445 #[doc = "ID: 283"]
33446 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33447 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33448 #[doc = ""]
33449 #[doc = "ID: 284"]
33450 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33451 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33452 #[doc = ""]
33453 #[doc = "ID: 280"]
33454 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33455 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33456 #[doc = ""]
33457 #[doc = "ID: 282"]
33458 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33459 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33460 #[doc = ""]
33461 #[doc = "ID: 288"]
33462 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33463 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33464 #[doc = ""]
33465 #[doc = "ID: 287"]
33466 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33467 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33468 #[doc = ""]
33469 #[doc = "ID: 281"]
33470 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33471 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33472 #[doc = ""]
33473 #[doc = "ID: 33"]
33474 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33475 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33476 #[doc = ""]
33477 #[doc = "ID: 63"]
33478 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33479 #[doc = "Global position/attitude estimate from a vision source."]
33480 #[doc = ""]
33481 #[doc = "ID: 101"]
33482 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33483 #[doc = "Second GPS data."]
33484 #[doc = ""]
33485 #[doc = "ID: 124"]
33486 GPS2_RAW(GPS2_RAW_DATA),
33487 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33488 #[doc = ""]
33489 #[doc = "ID: 128"]
33490 GPS2_RTK(GPS2_RTK_DATA),
33491 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33492 #[doc = ""]
33493 #[doc = "ID: 49"]
33494 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33495 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33496 #[doc = ""]
33497 #[doc = "ID: 123"]
33498 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33499 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33500 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33501 #[doc = ""]
33502 #[doc = "ID: 232"]
33503 GPS_INPUT(GPS_INPUT_DATA),
33504 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33505 #[doc = ""]
33506 #[doc = "ID: 24"]
33507 GPS_RAW_INT(GPS_RAW_INT_DATA),
33508 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
33509 #[doc = ""]
33510 #[doc = "ID: 233"]
33511 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33512 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33513 #[doc = ""]
33514 #[doc = "ID: 127"]
33515 GPS_RTK(GPS_RTK_DATA),
33516 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
33517 #[doc = ""]
33518 #[doc = "ID: 25"]
33519 GPS_STATUS(GPS_STATUS_DATA),
33520 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
33521 #[doc = ""]
33522 #[doc = "ID: 0"]
33523 HEARTBEAT(HEARTBEAT_DATA),
33524 #[doc = "The IMU readings in SI units in NED body frame."]
33525 #[doc = ""]
33526 #[doc = "ID: 105"]
33527 HIGHRES_IMU(HIGHRES_IMU_DATA),
33528 #[doc = "Message appropriate for high latency connections like Iridium."]
33529 #[doc = ""]
33530 #[doc = "ID: 234"]
33531 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33532 HIGH_LATENCY(HIGH_LATENCY_DATA),
33533 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
33534 #[doc = ""]
33535 #[doc = "ID: 235"]
33536 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33537 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
33538 #[doc = ""]
33539 #[doc = "ID: 93"]
33540 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33541 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
33542 #[doc = ""]
33543 #[doc = "ID: 91"]
33544 HIL_CONTROLS(HIL_CONTROLS_DATA),
33545 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33546 #[doc = ""]
33547 #[doc = "ID: 113"]
33548 HIL_GPS(HIL_GPS_DATA),
33549 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
33550 #[doc = ""]
33551 #[doc = "ID: 114"]
33552 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33553 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
33554 #[doc = ""]
33555 #[doc = "ID: 92"]
33556 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33557 #[doc = "The IMU readings in SI units in NED body frame."]
33558 #[doc = ""]
33559 #[doc = "ID: 107"]
33560 HIL_SENSOR(HIL_SENSOR_DATA),
33561 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33562 #[doc = ""]
33563 #[doc = "ID: 90"]
33564 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33565 HIL_STATE(HIL_STATE_DATA),
33566 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33567 #[doc = ""]
33568 #[doc = "ID: 115"]
33569 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33570 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
33571 #[doc = ""]
33572 #[doc = "ID: 242"]
33573 HOME_POSITION(HOME_POSITION_DATA),
33574 #[doc = "Temperature and humidity from hygrometer."]
33575 #[doc = ""]
33576 #[doc = "ID: 12920"]
33577 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33578 #[doc = "Illuminator status."]
33579 #[doc = ""]
33580 #[doc = "ID: 440"]
33581 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33582 #[doc = "Status of the Iridium SBD link."]
33583 #[doc = ""]
33584 #[doc = "ID: 335"]
33585 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33586 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
33587 #[doc = ""]
33588 #[doc = "ID: 149"]
33589 LANDING_TARGET(LANDING_TARGET_DATA),
33590 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
33591 #[doc = ""]
33592 #[doc = "ID: 8"]
33593 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33594 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33595 #[doc = ""]
33596 #[doc = "ID: 32"]
33597 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33598 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33599 #[doc = ""]
33600 #[doc = "ID: 64"]
33601 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33602 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33603 #[doc = ""]
33604 #[doc = "ID: 89"]
33605 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33606 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
33607 #[doc = ""]
33608 #[doc = "ID: 268"]
33609 LOGGING_ACK(LOGGING_ACK_DATA),
33610 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
33611 #[doc = ""]
33612 #[doc = "ID: 266"]
33613 LOGGING_DATA(LOGGING_DATA_DATA),
33614 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33615 #[doc = ""]
33616 #[doc = "ID: 267"]
33617 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33618 #[doc = "Reply to LOG_REQUEST_DATA."]
33619 #[doc = ""]
33620 #[doc = "ID: 120"]
33621 LOG_DATA(LOG_DATA_DATA),
33622 #[doc = "Reply to LOG_REQUEST_LIST."]
33623 #[doc = ""]
33624 #[doc = "ID: 118"]
33625 LOG_ENTRY(LOG_ENTRY_DATA),
33626 #[doc = "Erase all logs."]
33627 #[doc = ""]
33628 #[doc = "ID: 121"]
33629 LOG_ERASE(LOG_ERASE_DATA),
33630 #[doc = "Request a chunk of a log."]
33631 #[doc = ""]
33632 #[doc = "ID: 119"]
33633 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33634 #[doc = "Stop log transfer and resume normal logging."]
33635 #[doc = ""]
33636 #[doc = "ID: 122"]
33637 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33638 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33639 #[doc = ""]
33640 #[doc = "ID: 117"]
33641 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33642 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33643 #[doc = ""]
33644 #[doc = "ID: 192"]
33645 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33646 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33647 #[doc = ""]
33648 #[doc = "ID: 69"]
33649 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33650 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33651 #[doc = ""]
33652 #[doc = "ID: 81"]
33653 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33654 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33655 #[doc = ""]
33656 #[doc = "ID: 249"]
33657 MEMORY_VECT(MEMORY_VECT_DATA),
33658 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33659 #[doc = ""]
33660 #[doc = "ID: 244"]
33661 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33662 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33663 #[doc = ""]
33664 #[doc = "ID: 47"]
33665 MISSION_ACK(MISSION_ACK_DATA),
33666 #[doc = "Delete all mission items at once."]
33667 #[doc = ""]
33668 #[doc = "ID: 45"]
33669 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33670 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33671 #[doc = ""]
33672 #[doc = "ID: 44"]
33673 MISSION_COUNT(MISSION_COUNT_DATA),
33674 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33675 #[doc = ""]
33676 #[doc = "ID: 42"]
33677 MISSION_CURRENT(MISSION_CURRENT_DATA),
33678 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33679 #[doc = ""]
33680 #[doc = "ID: 39"]
33681 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33682 MISSION_ITEM(MISSION_ITEM_DATA),
33683 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33684 #[doc = ""]
33685 #[doc = "ID: 73"]
33686 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33687 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33688 #[doc = ""]
33689 #[doc = "ID: 46"]
33690 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33691 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33692 #[doc = ""]
33693 #[doc = "ID: 40"]
33694 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33695 MISSION_REQUEST(MISSION_REQUEST_DATA),
33696 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33697 #[doc = ""]
33698 #[doc = "ID: 51"]
33699 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33700 #[doc = "Request the overall list of mission items from the system/component."]
33701 #[doc = ""]
33702 #[doc = "ID: 43"]
33703 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33704 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33705 #[doc = ""]
33706 #[doc = "ID: 37"]
33707 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33708 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33709 #[doc = ""]
33710 #[doc = "ID: 41"]
33711 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33712 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33713 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33714 #[doc = ""]
33715 #[doc = "ID: 38"]
33716 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33717 #[doc = "Orientation of a mount."]
33718 #[doc = ""]
33719 #[doc = "ID: 265"]
33720 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33721 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33722 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33723 #[doc = ""]
33724 #[doc = "ID: 251"]
33725 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33726 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33727 #[doc = ""]
33728 #[doc = "ID: 252"]
33729 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33730 #[doc = "The state of the navigation and position controller."]
33731 #[doc = ""]
33732 #[doc = "ID: 62"]
33733 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33734 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33735 #[doc = ""]
33736 #[doc = "ID: 330"]
33737 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33738 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33739 #[doc = ""]
33740 #[doc = "ID: 331"]
33741 ODOMETRY(ODOMETRY_DATA),
33742 #[doc = "Hardware status sent by an onboard computer."]
33743 #[doc = ""]
33744 #[doc = "ID: 390"]
33745 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33746 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33747 #[doc = ""]
33748 #[doc = "ID: 12918"]
33749 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33750 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33751 #[doc = ""]
33752 #[doc = "ID: 12902"]
33753 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33754 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33755 #[doc = ""]
33756 #[doc = "ID: 12900"]
33757 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33758 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33759 #[doc = ""]
33760 #[doc = "ID: 12901"]
33761 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33762 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33763 #[doc = ""]
33764 #[doc = "ID: 12915"]
33765 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33766 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33767 #[doc = ""]
33768 #[doc = "ID: 12905"]
33769 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33770 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33771 #[doc = ""]
33772 #[doc = "ID: 12903"]
33773 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33774 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33775 #[doc = ""]
33776 #[doc = "ID: 12904"]
33777 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33778 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33779 #[doc = ""]
33780 #[doc = "ID: 12919"]
33781 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33782 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33783 #[doc = ""]
33784 #[doc = "ID: 100"]
33785 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33786 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33787 #[doc = ""]
33788 #[doc = "ID: 106"]
33789 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33790 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33791 #[doc = ""]
33792 #[doc = "ID: 360"]
33793 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33794 #[doc = "Response from a PARAM_EXT_SET message."]
33795 #[doc = ""]
33796 #[doc = "ID: 324"]
33797 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33798 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33799 #[doc = ""]
33800 #[doc = "ID: 321"]
33801 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33802 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33803 #[doc = ""]
33804 #[doc = "ID: 320"]
33805 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33806 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33807 #[doc = ""]
33808 #[doc = "ID: 323"]
33809 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33810 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33811 #[doc = ""]
33812 #[doc = "ID: 322"]
33813 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33814 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33815 #[doc = ""]
33816 #[doc = "ID: 50"]
33817 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33818 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33819 #[doc = ""]
33820 #[doc = "ID: 21"]
33821 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33822 #[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33823 #[doc = ""]
33824 #[doc = "ID: 20"]
33825 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33826 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33827 #[doc = ""]
33828 #[doc = "ID: 23"]
33829 PARAM_SET(PARAM_SET_DATA),
33830 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33831 #[doc = ""]
33832 #[doc = "ID: 22"]
33833 PARAM_VALUE(PARAM_VALUE_DATA),
33834 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33835 #[doc = ""]
33836 #[doc = "ID: 4"]
33837 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33838 PING(PING_DATA),
33839 #[doc = "Control vehicle tone generation (buzzer)."]
33840 #[doc = ""]
33841 #[doc = "ID: 258"]
33842 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33843 PLAY_TUNE(PLAY_TUNE_DATA),
33844 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33845 #[doc = ""]
33846 #[doc = "ID: 400"]
33847 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33848 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33849 #[doc = ""]
33850 #[doc = "ID: 87"]
33851 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33852 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33853 #[doc = ""]
33854 #[doc = "ID: 85"]
33855 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33856 #[doc = "Power supply status."]
33857 #[doc = ""]
33858 #[doc = "ID: 125"]
33859 POWER_STATUS(POWER_STATUS_DATA),
33860 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33861 #[doc = ""]
33862 #[doc = "ID: 300"]
33863 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33864 #[doc = "Status generated by radio and injected into MAVLink stream."]
33865 #[doc = ""]
33866 #[doc = "ID: 109"]
33867 RADIO_STATUS(RADIO_STATUS_DATA),
33868 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33869 #[doc = ""]
33870 #[doc = "ID: 27"]
33871 RAW_IMU(RAW_IMU_DATA),
33872 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33873 #[doc = ""]
33874 #[doc = "ID: 28"]
33875 RAW_PRESSURE(RAW_PRESSURE_DATA),
33876 #[doc = "RPM sensor data message."]
33877 #[doc = ""]
33878 #[doc = "ID: 339"]
33879 RAW_RPM(RAW_RPM_DATA),
33880 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33881 #[doc = ""]
33882 #[doc = "ID: 65"]
33883 RC_CHANNELS(RC_CHANNELS_DATA),
33884 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33885 #[doc = ""]
33886 #[doc = "ID: 70"]
33887 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33888 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33889 #[doc = ""]
33890 #[doc = "ID: 35"]
33891 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33892 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33893 #[doc = ""]
33894 #[doc = "ID: 34"]
33895 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33896 #[doc = "Request a data stream."]
33897 #[doc = ""]
33898 #[doc = "ID: 66"]
33899 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33900 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33901 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33902 #[doc = ""]
33903 #[doc = "ID: 412"]
33904 REQUEST_EVENT(REQUEST_EVENT_DATA),
33905 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33906 #[doc = ""]
33907 #[doc = "ID: 142"]
33908 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33909 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33910 #[doc = ""]
33911 #[doc = "ID: 413"]
33912 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33913 #[doc = "Read out the safety zone the MAV currently assumes."]
33914 #[doc = ""]
33915 #[doc = "ID: 55"]
33916 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33917 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33918 #[doc = ""]
33919 #[doc = "ID: 54"]
33920 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33921 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33922 #[doc = ""]
33923 #[doc = "ID: 26"]
33924 SCALED_IMU(SCALED_IMU_DATA),
33925 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33926 #[doc = ""]
33927 #[doc = "ID: 116"]
33928 SCALED_IMU2(SCALED_IMU2_DATA),
33929 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33930 #[doc = ""]
33931 #[doc = "ID: 129"]
33932 SCALED_IMU3(SCALED_IMU3_DATA),
33933 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33934 #[doc = ""]
33935 #[doc = "ID: 29"]
33936 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33937 #[doc = "Barometer readings for 2nd barometer."]
33938 #[doc = ""]
33939 #[doc = "ID: 137"]
33940 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33941 #[doc = "Barometer readings for 3rd barometer."]
33942 #[doc = ""]
33943 #[doc = "ID: 143"]
33944 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33945 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33946 #[doc = ""]
33947 #[doc = "ID: 126"]
33948 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33949 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33950 #[doc = ""]
33951 #[doc = "ID: 36"]
33952 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33953 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33954 #[doc = ""]
33955 #[doc = "ID: 256"]
33956 SETUP_SIGNING(SETUP_SIGNING_DATA),
33957 #[doc = "Set the vehicle attitude and body angular rates."]
33958 #[doc = ""]
33959 #[doc = "ID: 139"]
33960 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33961 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33962 #[doc = ""]
33963 #[doc = "ID: 82"]
33964 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33965 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33966 #[doc = ""]
33967 #[doc = "ID: 48"]
33968 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33969 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33970 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33971 #[doc = ""]
33972 #[doc = "ID: 243"]
33973 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33974 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33975 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33976 #[doc = ""]
33977 #[doc = "ID: 11"]
33978 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33979 SET_MODE(SET_MODE_DATA),
33980 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33981 #[doc = ""]
33982 #[doc = "ID: 86"]
33983 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33984 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33985 #[doc = ""]
33986 #[doc = "ID: 84"]
33987 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33988 #[doc = "Status of simulation environment, if used."]
33989 #[doc = ""]
33990 #[doc = "ID: 108"]
33991 SIM_STATE(SIM_STATE_DATA),
33992 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33993 #[doc = ""]
33994 #[doc = "ID: 370"]
33995 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33996 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33997 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33998 #[doc = ""]
33999 #[doc = "ID: 253"]
34000 STATUSTEXT(STATUSTEXT_DATA),
34001 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
34002 #[doc = ""]
34003 #[doc = "ID: 261"]
34004 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
34005 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
34006 #[doc = ""]
34007 #[doc = "ID: 401"]
34008 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
34009 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
34010 #[doc = ""]
34011 #[doc = "ID: 2"]
34012 SYSTEM_TIME(SYSTEM_TIME_DATA),
34013 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
34014 #[doc = ""]
34015 #[doc = "ID: 1"]
34016 SYS_STATUS(SYS_STATUS_DATA),
34017 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
34018 #[doc = ""]
34019 #[doc = "ID: 135"]
34020 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
34021 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34022 #[doc = ""]
34023 #[doc = "ID: 134"]
34024 TERRAIN_DATA(TERRAIN_DATA_DATA),
34025 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34026 #[doc = ""]
34027 #[doc = "ID: 136"]
34028 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
34029 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
34030 #[doc = ""]
34031 #[doc = "ID: 133"]
34032 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
34033 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
34034 #[doc = ""]
34035 #[doc = "ID: 111"]
34036 TIMESYNC(TIMESYNC_DATA),
34037 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
34038 #[doc = ""]
34039 #[doc = "ID: 380"]
34040 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
34041 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
34042 #[doc = ""]
34043 #[doc = "ID: 333"]
34044 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
34045 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
34046 #[doc = ""]
34047 #[doc = "ID: 332"]
34048 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
34049 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
34050 #[doc = ""]
34051 #[doc = "ID: 385"]
34052 TUNNEL(TUNNEL_DATA),
34053 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
34054 #[doc = ""]
34055 #[doc = "ID: 311"]
34056 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
34057 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
34058 #[doc = ""]
34059 #[doc = "ID: 310"]
34060 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
34061 #[doc = "Request messages."]
34062 #[doc = ""]
34063 #[doc = "ID: 10006"]
34064 UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA),
34065 #[doc = "Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter)."]
34066 #[doc = ""]
34067 #[doc = "ID: 10001"]
34068 UAVIONIX_ADSB_OUT_CFG(UAVIONIX_ADSB_OUT_CFG_DATA),
34069 #[doc = "Flight Identification for ADSB-Out vehicles."]
34070 #[doc = ""]
34071 #[doc = "ID: 10005"]
34072 UAVIONIX_ADSB_OUT_CFG_FLIGHTID(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA),
34073 #[doc = "Aircraft Registration."]
34074 #[doc = ""]
34075 #[doc = "ID: 10004"]
34076 UAVIONIX_ADSB_OUT_CFG_REGISTRATION(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA),
34077 #[doc = "Control message with all data sent in UCP control message."]
34078 #[doc = ""]
34079 #[doc = "ID: 10007"]
34080 UAVIONIX_ADSB_OUT_CONTROL(UAVIONIX_ADSB_OUT_CONTROL_DATA),
34081 #[doc = "Dynamic data used to generate ADS-B out transponder data (send at 5Hz)."]
34082 #[doc = ""]
34083 #[doc = "ID: 10002"]
34084 UAVIONIX_ADSB_OUT_DYNAMIC(UAVIONIX_ADSB_OUT_DYNAMIC_DATA),
34085 #[doc = "Status message with information from UCP Heartbeat and Status messages."]
34086 #[doc = ""]
34087 #[doc = "ID: 10008"]
34088 UAVIONIX_ADSB_OUT_STATUS(UAVIONIX_ADSB_OUT_STATUS_DATA),
34089 #[doc = "Transceiver heartbeat with health report (updated every 10s)."]
34090 #[doc = ""]
34091 #[doc = "ID: 10003"]
34092 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA),
34093 #[doc = "The global position resulting from GPS and sensor fusion."]
34094 #[doc = ""]
34095 #[doc = "ID: 340"]
34096 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
34097 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
34098 #[doc = ""]
34099 #[doc = "ID: 248"]
34100 V2_EXTENSION(V2_EXTENSION_DATA),
34101 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
34102 #[doc = ""]
34103 #[doc = "ID: 74"]
34104 VFR_HUD(VFR_HUD_DATA),
34105 #[doc = "Vibration levels and accelerometer clipping."]
34106 #[doc = ""]
34107 #[doc = "ID: 241"]
34108 VIBRATION(VIBRATION_DATA),
34109 #[doc = "Global position estimate from a Vicon motion system source."]
34110 #[doc = ""]
34111 #[doc = "ID: 104"]
34112 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
34113 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
34114 #[doc = ""]
34115 #[doc = "ID: 269"]
34116 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
34117 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
34118 #[doc = ""]
34119 #[doc = "ID: 270"]
34120 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
34121 #[doc = "Local position/attitude estimate from a vision source."]
34122 #[doc = ""]
34123 #[doc = "ID: 102"]
34124 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
34125 #[doc = "Speed estimate from a vision source."]
34126 #[doc = ""]
34127 #[doc = "ID: 103"]
34128 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
34129 #[doc = "Cumulative distance traveled for each reported wheel."]
34130 #[doc = ""]
34131 #[doc = "ID: 9000"]
34132 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
34133 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
34134 #[doc = ""]
34135 #[doc = "ID: 299"]
34136 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
34137 #[doc = "Winch status."]
34138 #[doc = ""]
34139 #[doc = "ID: 9005"]
34140 WINCH_STATUS(WINCH_STATUS_DATA),
34141 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
34142 #[doc = ""]
34143 #[doc = "ID: 231"]
34144 WIND_COV(WIND_COV_DATA),
34145}
34146impl MavMessage {
34147 pub const fn all_ids() -> &'static [u32] {
34148 &[
34149 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
34150 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
34151 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
34152 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
34153 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
34154 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
34155 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
34156 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
34157 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
34158 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
34159 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
34160 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
34161 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
34162 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
34163 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
34164 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
34165 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
34166 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
34167 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
34168 440u32, 9000u32, 9005u32, 10001u32, 10002u32, 10003u32, 10004u32, 10005u32, 10006u32,
34169 10007u32, 10008u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
34170 12915u32, 12918u32, 12919u32, 12920u32,
34171 ]
34172 }
34173 pub const fn all_messages() -> &'static [(&'static str, u32)] {
34174 &[
34175 (HEARTBEAT_DATA::NAME, HEARTBEAT_DATA::ID),
34176 (SYS_STATUS_DATA::NAME, SYS_STATUS_DATA::ID),
34177 (SYSTEM_TIME_DATA::NAME, SYSTEM_TIME_DATA::ID),
34178 (PING_DATA::NAME, PING_DATA::ID),
34179 (
34180 CHANGE_OPERATOR_CONTROL_DATA::NAME,
34181 CHANGE_OPERATOR_CONTROL_DATA::ID,
34182 ),
34183 (
34184 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34185 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34186 ),
34187 (AUTH_KEY_DATA::NAME, AUTH_KEY_DATA::ID),
34188 (LINK_NODE_STATUS_DATA::NAME, LINK_NODE_STATUS_DATA::ID),
34189 (SET_MODE_DATA::NAME, SET_MODE_DATA::ID),
34190 (PARAM_REQUEST_READ_DATA::NAME, PARAM_REQUEST_READ_DATA::ID),
34191 (PARAM_REQUEST_LIST_DATA::NAME, PARAM_REQUEST_LIST_DATA::ID),
34192 (PARAM_VALUE_DATA::NAME, PARAM_VALUE_DATA::ID),
34193 (PARAM_SET_DATA::NAME, PARAM_SET_DATA::ID),
34194 (GPS_RAW_INT_DATA::NAME, GPS_RAW_INT_DATA::ID),
34195 (GPS_STATUS_DATA::NAME, GPS_STATUS_DATA::ID),
34196 (SCALED_IMU_DATA::NAME, SCALED_IMU_DATA::ID),
34197 (RAW_IMU_DATA::NAME, RAW_IMU_DATA::ID),
34198 (RAW_PRESSURE_DATA::NAME, RAW_PRESSURE_DATA::ID),
34199 (SCALED_PRESSURE_DATA::NAME, SCALED_PRESSURE_DATA::ID),
34200 (ATTITUDE_DATA::NAME, ATTITUDE_DATA::ID),
34201 (ATTITUDE_QUATERNION_DATA::NAME, ATTITUDE_QUATERNION_DATA::ID),
34202 (LOCAL_POSITION_NED_DATA::NAME, LOCAL_POSITION_NED_DATA::ID),
34203 (GLOBAL_POSITION_INT_DATA::NAME, GLOBAL_POSITION_INT_DATA::ID),
34204 (RC_CHANNELS_SCALED_DATA::NAME, RC_CHANNELS_SCALED_DATA::ID),
34205 (RC_CHANNELS_RAW_DATA::NAME, RC_CHANNELS_RAW_DATA::ID),
34206 (SERVO_OUTPUT_RAW_DATA::NAME, SERVO_OUTPUT_RAW_DATA::ID),
34207 (
34208 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34209 MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34210 ),
34211 (
34212 MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34213 MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34214 ),
34215 (MISSION_ITEM_DATA::NAME, MISSION_ITEM_DATA::ID),
34216 (MISSION_REQUEST_DATA::NAME, MISSION_REQUEST_DATA::ID),
34217 (MISSION_SET_CURRENT_DATA::NAME, MISSION_SET_CURRENT_DATA::ID),
34218 (MISSION_CURRENT_DATA::NAME, MISSION_CURRENT_DATA::ID),
34219 (
34220 MISSION_REQUEST_LIST_DATA::NAME,
34221 MISSION_REQUEST_LIST_DATA::ID,
34222 ),
34223 (MISSION_COUNT_DATA::NAME, MISSION_COUNT_DATA::ID),
34224 (MISSION_CLEAR_ALL_DATA::NAME, MISSION_CLEAR_ALL_DATA::ID),
34225 (
34226 MISSION_ITEM_REACHED_DATA::NAME,
34227 MISSION_ITEM_REACHED_DATA::ID,
34228 ),
34229 (MISSION_ACK_DATA::NAME, MISSION_ACK_DATA::ID),
34230 (
34231 SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34232 SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34233 ),
34234 (GPS_GLOBAL_ORIGIN_DATA::NAME, GPS_GLOBAL_ORIGIN_DATA::ID),
34235 (PARAM_MAP_RC_DATA::NAME, PARAM_MAP_RC_DATA::ID),
34236 (MISSION_REQUEST_INT_DATA::NAME, MISSION_REQUEST_INT_DATA::ID),
34237 (
34238 SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34239 SAFETY_SET_ALLOWED_AREA_DATA::ID,
34240 ),
34241 (SAFETY_ALLOWED_AREA_DATA::NAME, SAFETY_ALLOWED_AREA_DATA::ID),
34242 (
34243 ATTITUDE_QUATERNION_COV_DATA::NAME,
34244 ATTITUDE_QUATERNION_COV_DATA::ID,
34245 ),
34246 (
34247 NAV_CONTROLLER_OUTPUT_DATA::NAME,
34248 NAV_CONTROLLER_OUTPUT_DATA::ID,
34249 ),
34250 (
34251 GLOBAL_POSITION_INT_COV_DATA::NAME,
34252 GLOBAL_POSITION_INT_COV_DATA::ID,
34253 ),
34254 (
34255 LOCAL_POSITION_NED_COV_DATA::NAME,
34256 LOCAL_POSITION_NED_COV_DATA::ID,
34257 ),
34258 (RC_CHANNELS_DATA::NAME, RC_CHANNELS_DATA::ID),
34259 (REQUEST_DATA_STREAM_DATA::NAME, REQUEST_DATA_STREAM_DATA::ID),
34260 (DATA_STREAM_DATA::NAME, DATA_STREAM_DATA::ID),
34261 (MANUAL_CONTROL_DATA::NAME, MANUAL_CONTROL_DATA::ID),
34262 (
34263 RC_CHANNELS_OVERRIDE_DATA::NAME,
34264 RC_CHANNELS_OVERRIDE_DATA::ID,
34265 ),
34266 (MISSION_ITEM_INT_DATA::NAME, MISSION_ITEM_INT_DATA::ID),
34267 (VFR_HUD_DATA::NAME, VFR_HUD_DATA::ID),
34268 (COMMAND_INT_DATA::NAME, COMMAND_INT_DATA::ID),
34269 (COMMAND_LONG_DATA::NAME, COMMAND_LONG_DATA::ID),
34270 (COMMAND_ACK_DATA::NAME, COMMAND_ACK_DATA::ID),
34271 (COMMAND_CANCEL_DATA::NAME, COMMAND_CANCEL_DATA::ID),
34272 (MANUAL_SETPOINT_DATA::NAME, MANUAL_SETPOINT_DATA::ID),
34273 (SET_ATTITUDE_TARGET_DATA::NAME, SET_ATTITUDE_TARGET_DATA::ID),
34274 (ATTITUDE_TARGET_DATA::NAME, ATTITUDE_TARGET_DATA::ID),
34275 (
34276 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34277 SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34278 ),
34279 (
34280 POSITION_TARGET_LOCAL_NED_DATA::NAME,
34281 POSITION_TARGET_LOCAL_NED_DATA::ID,
34282 ),
34283 (
34284 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34285 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34286 ),
34287 (
34288 POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34289 POSITION_TARGET_GLOBAL_INT_DATA::ID,
34290 ),
34291 (
34292 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME,
34293 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID,
34294 ),
34295 (HIL_STATE_DATA::NAME, HIL_STATE_DATA::ID),
34296 (HIL_CONTROLS_DATA::NAME, HIL_CONTROLS_DATA::ID),
34297 (HIL_RC_INPUTS_RAW_DATA::NAME, HIL_RC_INPUTS_RAW_DATA::ID),
34298 (
34299 HIL_ACTUATOR_CONTROLS_DATA::NAME,
34300 HIL_ACTUATOR_CONTROLS_DATA::ID,
34301 ),
34302 (OPTICAL_FLOW_DATA::NAME, OPTICAL_FLOW_DATA::ID),
34303 (
34304 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34305 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34306 ),
34307 (
34308 VISION_POSITION_ESTIMATE_DATA::NAME,
34309 VISION_POSITION_ESTIMATE_DATA::ID,
34310 ),
34311 (
34312 VISION_SPEED_ESTIMATE_DATA::NAME,
34313 VISION_SPEED_ESTIMATE_DATA::ID,
34314 ),
34315 (
34316 VICON_POSITION_ESTIMATE_DATA::NAME,
34317 VICON_POSITION_ESTIMATE_DATA::ID,
34318 ),
34319 (HIGHRES_IMU_DATA::NAME, HIGHRES_IMU_DATA::ID),
34320 (OPTICAL_FLOW_RAD_DATA::NAME, OPTICAL_FLOW_RAD_DATA::ID),
34321 (HIL_SENSOR_DATA::NAME, HIL_SENSOR_DATA::ID),
34322 (SIM_STATE_DATA::NAME, SIM_STATE_DATA::ID),
34323 (RADIO_STATUS_DATA::NAME, RADIO_STATUS_DATA::ID),
34324 (
34325 FILE_TRANSFER_PROTOCOL_DATA::NAME,
34326 FILE_TRANSFER_PROTOCOL_DATA::ID,
34327 ),
34328 (TIMESYNC_DATA::NAME, TIMESYNC_DATA::ID),
34329 (CAMERA_TRIGGER_DATA::NAME, CAMERA_TRIGGER_DATA::ID),
34330 (HIL_GPS_DATA::NAME, HIL_GPS_DATA::ID),
34331 (HIL_OPTICAL_FLOW_DATA::NAME, HIL_OPTICAL_FLOW_DATA::ID),
34332 (
34333 HIL_STATE_QUATERNION_DATA::NAME,
34334 HIL_STATE_QUATERNION_DATA::ID,
34335 ),
34336 (SCALED_IMU2_DATA::NAME, SCALED_IMU2_DATA::ID),
34337 (LOG_REQUEST_LIST_DATA::NAME, LOG_REQUEST_LIST_DATA::ID),
34338 (LOG_ENTRY_DATA::NAME, LOG_ENTRY_DATA::ID),
34339 (LOG_REQUEST_DATA_DATA::NAME, LOG_REQUEST_DATA_DATA::ID),
34340 (LOG_DATA_DATA::NAME, LOG_DATA_DATA::ID),
34341 (LOG_ERASE_DATA::NAME, LOG_ERASE_DATA::ID),
34342 (LOG_REQUEST_END_DATA::NAME, LOG_REQUEST_END_DATA::ID),
34343 (GPS_INJECT_DATA_DATA::NAME, GPS_INJECT_DATA_DATA::ID),
34344 (GPS2_RAW_DATA::NAME, GPS2_RAW_DATA::ID),
34345 (POWER_STATUS_DATA::NAME, POWER_STATUS_DATA::ID),
34346 (SERIAL_CONTROL_DATA::NAME, SERIAL_CONTROL_DATA::ID),
34347 (GPS_RTK_DATA::NAME, GPS_RTK_DATA::ID),
34348 (GPS2_RTK_DATA::NAME, GPS2_RTK_DATA::ID),
34349 (SCALED_IMU3_DATA::NAME, SCALED_IMU3_DATA::ID),
34350 (
34351 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34352 DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34353 ),
34354 (ENCAPSULATED_DATA_DATA::NAME, ENCAPSULATED_DATA_DATA::ID),
34355 (DISTANCE_SENSOR_DATA::NAME, DISTANCE_SENSOR_DATA::ID),
34356 (TERRAIN_REQUEST_DATA::NAME, TERRAIN_REQUEST_DATA::ID),
34357 (TERRAIN_DATA_DATA::NAME, TERRAIN_DATA_DATA::ID),
34358 (TERRAIN_CHECK_DATA::NAME, TERRAIN_CHECK_DATA::ID),
34359 (TERRAIN_REPORT_DATA::NAME, TERRAIN_REPORT_DATA::ID),
34360 (SCALED_PRESSURE2_DATA::NAME, SCALED_PRESSURE2_DATA::ID),
34361 (ATT_POS_MOCAP_DATA::NAME, ATT_POS_MOCAP_DATA::ID),
34362 (
34363 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34364 SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34365 ),
34366 (
34367 ACTUATOR_CONTROL_TARGET_DATA::NAME,
34368 ACTUATOR_CONTROL_TARGET_DATA::ID,
34369 ),
34370 (ALTITUDE_DATA::NAME, ALTITUDE_DATA::ID),
34371 (RESOURCE_REQUEST_DATA::NAME, RESOURCE_REQUEST_DATA::ID),
34372 (SCALED_PRESSURE3_DATA::NAME, SCALED_PRESSURE3_DATA::ID),
34373 (FOLLOW_TARGET_DATA::NAME, FOLLOW_TARGET_DATA::ID),
34374 (
34375 CONTROL_SYSTEM_STATE_DATA::NAME,
34376 CONTROL_SYSTEM_STATE_DATA::ID,
34377 ),
34378 (BATTERY_STATUS_DATA::NAME, BATTERY_STATUS_DATA::ID),
34379 (AUTOPILOT_VERSION_DATA::NAME, AUTOPILOT_VERSION_DATA::ID),
34380 (LANDING_TARGET_DATA::NAME, LANDING_TARGET_DATA::ID),
34381 (FENCE_STATUS_DATA::NAME, FENCE_STATUS_DATA::ID),
34382 (MAG_CAL_REPORT_DATA::NAME, MAG_CAL_REPORT_DATA::ID),
34383 (EFI_STATUS_DATA::NAME, EFI_STATUS_DATA::ID),
34384 (ESTIMATOR_STATUS_DATA::NAME, ESTIMATOR_STATUS_DATA::ID),
34385 (WIND_COV_DATA::NAME, WIND_COV_DATA::ID),
34386 (GPS_INPUT_DATA::NAME, GPS_INPUT_DATA::ID),
34387 (GPS_RTCM_DATA_DATA::NAME, GPS_RTCM_DATA_DATA::ID),
34388 (HIGH_LATENCY_DATA::NAME, HIGH_LATENCY_DATA::ID),
34389 (HIGH_LATENCY2_DATA::NAME, HIGH_LATENCY2_DATA::ID),
34390 (VIBRATION_DATA::NAME, VIBRATION_DATA::ID),
34391 (HOME_POSITION_DATA::NAME, HOME_POSITION_DATA::ID),
34392 (SET_HOME_POSITION_DATA::NAME, SET_HOME_POSITION_DATA::ID),
34393 (MESSAGE_INTERVAL_DATA::NAME, MESSAGE_INTERVAL_DATA::ID),
34394 (EXTENDED_SYS_STATE_DATA::NAME, EXTENDED_SYS_STATE_DATA::ID),
34395 (ADSB_VEHICLE_DATA::NAME, ADSB_VEHICLE_DATA::ID),
34396 (COLLISION_DATA::NAME, COLLISION_DATA::ID),
34397 (V2_EXTENSION_DATA::NAME, V2_EXTENSION_DATA::ID),
34398 (MEMORY_VECT_DATA::NAME, MEMORY_VECT_DATA::ID),
34399 (DEBUG_VECT_DATA::NAME, DEBUG_VECT_DATA::ID),
34400 (NAMED_VALUE_FLOAT_DATA::NAME, NAMED_VALUE_FLOAT_DATA::ID),
34401 (NAMED_VALUE_INT_DATA::NAME, NAMED_VALUE_INT_DATA::ID),
34402 (STATUSTEXT_DATA::NAME, STATUSTEXT_DATA::ID),
34403 (DEBUG_DATA::NAME, DEBUG_DATA::ID),
34404 (SETUP_SIGNING_DATA::NAME, SETUP_SIGNING_DATA::ID),
34405 (BUTTON_CHANGE_DATA::NAME, BUTTON_CHANGE_DATA::ID),
34406 (PLAY_TUNE_DATA::NAME, PLAY_TUNE_DATA::ID),
34407 (CAMERA_INFORMATION_DATA::NAME, CAMERA_INFORMATION_DATA::ID),
34408 (CAMERA_SETTINGS_DATA::NAME, CAMERA_SETTINGS_DATA::ID),
34409 (STORAGE_INFORMATION_DATA::NAME, STORAGE_INFORMATION_DATA::ID),
34410 (
34411 CAMERA_CAPTURE_STATUS_DATA::NAME,
34412 CAMERA_CAPTURE_STATUS_DATA::ID,
34413 ),
34414 (
34415 CAMERA_IMAGE_CAPTURED_DATA::NAME,
34416 CAMERA_IMAGE_CAPTURED_DATA::ID,
34417 ),
34418 (FLIGHT_INFORMATION_DATA::NAME, FLIGHT_INFORMATION_DATA::ID),
34419 (MOUNT_ORIENTATION_DATA::NAME, MOUNT_ORIENTATION_DATA::ID),
34420 (LOGGING_DATA_DATA::NAME, LOGGING_DATA_DATA::ID),
34421 (LOGGING_DATA_ACKED_DATA::NAME, LOGGING_DATA_ACKED_DATA::ID),
34422 (LOGGING_ACK_DATA::NAME, LOGGING_ACK_DATA::ID),
34423 (
34424 VIDEO_STREAM_INFORMATION_DATA::NAME,
34425 VIDEO_STREAM_INFORMATION_DATA::ID,
34426 ),
34427 (VIDEO_STREAM_STATUS_DATA::NAME, VIDEO_STREAM_STATUS_DATA::ID),
34428 (CAMERA_FOV_STATUS_DATA::NAME, CAMERA_FOV_STATUS_DATA::ID),
34429 (
34430 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34431 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34432 ),
34433 (
34434 CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34435 CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34436 ),
34437 (
34438 CAMERA_THERMAL_RANGE_DATA::NAME,
34439 CAMERA_THERMAL_RANGE_DATA::ID,
34440 ),
34441 (
34442 GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34443 GIMBAL_MANAGER_INFORMATION_DATA::ID,
34444 ),
34445 (
34446 GIMBAL_MANAGER_STATUS_DATA::NAME,
34447 GIMBAL_MANAGER_STATUS_DATA::ID,
34448 ),
34449 (
34450 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34451 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34452 ),
34453 (
34454 GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34455 GIMBAL_DEVICE_INFORMATION_DATA::ID,
34456 ),
34457 (
34458 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34459 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34460 ),
34461 (
34462 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34463 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34464 ),
34465 (
34466 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME,
34467 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID,
34468 ),
34469 (
34470 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34471 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34472 ),
34473 (
34474 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME,
34475 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID,
34476 ),
34477 (ESC_INFO_DATA::NAME, ESC_INFO_DATA::ID),
34478 (ESC_STATUS_DATA::NAME, ESC_STATUS_DATA::ID),
34479 (WIFI_CONFIG_AP_DATA::NAME, WIFI_CONFIG_AP_DATA::ID),
34480 (PROTOCOL_VERSION_DATA::NAME, PROTOCOL_VERSION_DATA::ID),
34481 (AIS_VESSEL_DATA::NAME, AIS_VESSEL_DATA::ID),
34482 (UAVCAN_NODE_STATUS_DATA::NAME, UAVCAN_NODE_STATUS_DATA::ID),
34483 (UAVCAN_NODE_INFO_DATA::NAME, UAVCAN_NODE_INFO_DATA::ID),
34484 (
34485 PARAM_EXT_REQUEST_READ_DATA::NAME,
34486 PARAM_EXT_REQUEST_READ_DATA::ID,
34487 ),
34488 (
34489 PARAM_EXT_REQUEST_LIST_DATA::NAME,
34490 PARAM_EXT_REQUEST_LIST_DATA::ID,
34491 ),
34492 (PARAM_EXT_VALUE_DATA::NAME, PARAM_EXT_VALUE_DATA::ID),
34493 (PARAM_EXT_SET_DATA::NAME, PARAM_EXT_SET_DATA::ID),
34494 (PARAM_EXT_ACK_DATA::NAME, PARAM_EXT_ACK_DATA::ID),
34495 (OBSTACLE_DISTANCE_DATA::NAME, OBSTACLE_DISTANCE_DATA::ID),
34496 (ODOMETRY_DATA::NAME, ODOMETRY_DATA::ID),
34497 (
34498 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME,
34499 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID,
34500 ),
34501 (
34502 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME,
34503 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34504 ),
34505 (CELLULAR_STATUS_DATA::NAME, CELLULAR_STATUS_DATA::ID),
34506 (ISBD_LINK_STATUS_DATA::NAME, ISBD_LINK_STATUS_DATA::ID),
34507 (CELLULAR_CONFIG_DATA::NAME, CELLULAR_CONFIG_DATA::ID),
34508 (RAW_RPM_DATA::NAME, RAW_RPM_DATA::ID),
34509 (UTM_GLOBAL_POSITION_DATA::NAME, UTM_GLOBAL_POSITION_DATA::ID),
34510 (DEBUG_FLOAT_ARRAY_DATA::NAME, DEBUG_FLOAT_ARRAY_DATA::ID),
34511 (
34512 ORBIT_EXECUTION_STATUS_DATA::NAME,
34513 ORBIT_EXECUTION_STATUS_DATA::ID,
34514 ),
34515 (SMART_BATTERY_INFO_DATA::NAME, SMART_BATTERY_INFO_DATA::ID),
34516 (FUEL_STATUS_DATA::NAME, FUEL_STATUS_DATA::ID),
34517 (BATTERY_INFO_DATA::NAME, BATTERY_INFO_DATA::ID),
34518 (GENERATOR_STATUS_DATA::NAME, GENERATOR_STATUS_DATA::ID),
34519 (
34520 ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34521 ACTUATOR_OUTPUT_STATUS_DATA::ID,
34522 ),
34523 (
34524 TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34525 TIME_ESTIMATE_TO_TARGET_DATA::ID,
34526 ),
34527 (TUNNEL_DATA::NAME, TUNNEL_DATA::ID),
34528 (CAN_FRAME_DATA::NAME, CAN_FRAME_DATA::ID),
34529 (CANFD_FRAME_DATA::NAME, CANFD_FRAME_DATA::ID),
34530 (CAN_FILTER_MODIFY_DATA::NAME, CAN_FILTER_MODIFY_DATA::ID),
34531 (
34532 ONBOARD_COMPUTER_STATUS_DATA::NAME,
34533 ONBOARD_COMPUTER_STATUS_DATA::ID,
34534 ),
34535 (
34536 COMPONENT_INFORMATION_DATA::NAME,
34537 COMPONENT_INFORMATION_DATA::ID,
34538 ),
34539 (
34540 COMPONENT_INFORMATION_BASIC_DATA::NAME,
34541 COMPONENT_INFORMATION_BASIC_DATA::ID,
34542 ),
34543 (COMPONENT_METADATA_DATA::NAME, COMPONENT_METADATA_DATA::ID),
34544 (PLAY_TUNE_V2_DATA::NAME, PLAY_TUNE_V2_DATA::ID),
34545 (SUPPORTED_TUNES_DATA::NAME, SUPPORTED_TUNES_DATA::ID),
34546 (EVENT_DATA::NAME, EVENT_DATA::ID),
34547 (
34548 CURRENT_EVENT_SEQUENCE_DATA::NAME,
34549 CURRENT_EVENT_SEQUENCE_DATA::ID,
34550 ),
34551 (REQUEST_EVENT_DATA::NAME, REQUEST_EVENT_DATA::ID),
34552 (
34553 RESPONSE_EVENT_ERROR_DATA::NAME,
34554 RESPONSE_EVENT_ERROR_DATA::ID,
34555 ),
34556 (AVAILABLE_MODES_DATA::NAME, AVAILABLE_MODES_DATA::ID),
34557 (CURRENT_MODE_DATA::NAME, CURRENT_MODE_DATA::ID),
34558 (
34559 AVAILABLE_MODES_MONITOR_DATA::NAME,
34560 AVAILABLE_MODES_MONITOR_DATA::ID,
34561 ),
34562 (ILLUMINATOR_STATUS_DATA::NAME, ILLUMINATOR_STATUS_DATA::ID),
34563 (WHEEL_DISTANCE_DATA::NAME, WHEEL_DISTANCE_DATA::ID),
34564 (WINCH_STATUS_DATA::NAME, WINCH_STATUS_DATA::ID),
34565 (
34566 UAVIONIX_ADSB_OUT_CFG_DATA::NAME,
34567 UAVIONIX_ADSB_OUT_CFG_DATA::ID,
34568 ),
34569 (
34570 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME,
34571 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID,
34572 ),
34573 (
34574 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME,
34575 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID,
34576 ),
34577 (
34578 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME,
34579 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID,
34580 ),
34581 (
34582 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME,
34583 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID,
34584 ),
34585 (UAVIONIX_ADSB_GET_DATA::NAME, UAVIONIX_ADSB_GET_DATA::ID),
34586 (
34587 UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME,
34588 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID,
34589 ),
34590 (
34591 UAVIONIX_ADSB_OUT_STATUS_DATA::NAME,
34592 UAVIONIX_ADSB_OUT_STATUS_DATA::ID,
34593 ),
34594 (
34595 OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34596 OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34597 ),
34598 (
34599 OPEN_DRONE_ID_LOCATION_DATA::NAME,
34600 OPEN_DRONE_ID_LOCATION_DATA::ID,
34601 ),
34602 (
34603 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34604 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34605 ),
34606 (
34607 OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34608 OPEN_DRONE_ID_SELF_ID_DATA::ID,
34609 ),
34610 (
34611 OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34612 OPEN_DRONE_ID_SYSTEM_DATA::ID,
34613 ),
34614 (
34615 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34616 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34617 ),
34618 (
34619 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34620 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34621 ),
34622 (
34623 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34624 OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34625 ),
34626 (
34627 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34628 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34629 ),
34630 (HYGROMETER_SENSOR_DATA::NAME, HYGROMETER_SENSOR_DATA::ID),
34631 ]
34632 }
34633}
34634impl Message for MavMessage {
34635 fn parse(
34636 version: MavlinkVersion,
34637 id: u32,
34638 payload: &[u8],
34639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34640 match id {
34641 ACTUATOR_CONTROL_TARGET_DATA::ID => {
34642 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34643 .map(Self::ACTUATOR_CONTROL_TARGET)
34644 }
34645 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
34646 .map(Self::ACTUATOR_OUTPUT_STATUS),
34647 ADSB_VEHICLE_DATA::ID => {
34648 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
34649 }
34650 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
34651 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
34652 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
34653 ATTITUDE_QUATERNION_DATA::ID => {
34654 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
34655 }
34656 ATTITUDE_QUATERNION_COV_DATA::ID => {
34657 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
34658 .map(Self::ATTITUDE_QUATERNION_COV)
34659 }
34660 ATTITUDE_TARGET_DATA::ID => {
34661 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
34662 }
34663 ATT_POS_MOCAP_DATA::ID => {
34664 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
34665 }
34666 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
34667 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34668 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
34669 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
34670 }
34671 AUTOPILOT_VERSION_DATA::ID => {
34672 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
34673 }
34674 AVAILABLE_MODES_DATA::ID => {
34675 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
34676 }
34677 AVAILABLE_MODES_MONITOR_DATA::ID => {
34678 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
34679 .map(Self::AVAILABLE_MODES_MONITOR)
34680 }
34681 BATTERY_INFO_DATA::ID => {
34682 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
34683 }
34684 BATTERY_STATUS_DATA::ID => {
34685 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
34686 }
34687 BUTTON_CHANGE_DATA::ID => {
34688 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
34689 }
34690 CAMERA_CAPTURE_STATUS_DATA::ID => {
34691 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
34692 }
34693 CAMERA_FOV_STATUS_DATA::ID => {
34694 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
34695 }
34696 CAMERA_IMAGE_CAPTURED_DATA::ID => {
34697 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
34698 }
34699 CAMERA_INFORMATION_DATA::ID => {
34700 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
34701 }
34702 CAMERA_SETTINGS_DATA::ID => {
34703 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
34704 }
34705 CAMERA_THERMAL_RANGE_DATA::ID => {
34706 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
34707 }
34708 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
34709 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
34710 .map(Self::CAMERA_TRACKING_GEO_STATUS)
34711 }
34712 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
34713 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
34714 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
34715 }
34716 CAMERA_TRIGGER_DATA::ID => {
34717 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
34718 }
34719 CANFD_FRAME_DATA::ID => {
34720 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
34721 }
34722 CAN_FILTER_MODIFY_DATA::ID => {
34723 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
34724 }
34725 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
34726 CELLULAR_CONFIG_DATA::ID => {
34727 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
34728 }
34729 CELLULAR_STATUS_DATA::ID => {
34730 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
34731 }
34732 CHANGE_OPERATOR_CONTROL_DATA::ID => {
34733 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
34734 .map(Self::CHANGE_OPERATOR_CONTROL)
34735 }
34736 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
34737 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
34738 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
34739 }
34740 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
34741 COMMAND_ACK_DATA::ID => {
34742 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
34743 }
34744 COMMAND_CANCEL_DATA::ID => {
34745 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
34746 }
34747 COMMAND_INT_DATA::ID => {
34748 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
34749 }
34750 COMMAND_LONG_DATA::ID => {
34751 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
34752 }
34753 COMPONENT_INFORMATION_DATA::ID => {
34754 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
34755 }
34756 COMPONENT_INFORMATION_BASIC_DATA::ID => {
34757 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
34758 .map(Self::COMPONENT_INFORMATION_BASIC)
34759 }
34760 COMPONENT_METADATA_DATA::ID => {
34761 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
34762 }
34763 CONTROL_SYSTEM_STATE_DATA::ID => {
34764 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
34765 }
34766 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
34767 .map(Self::CURRENT_EVENT_SEQUENCE),
34768 CURRENT_MODE_DATA::ID => {
34769 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
34770 }
34771 DATA_STREAM_DATA::ID => {
34772 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
34773 }
34774 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
34775 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
34776 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
34777 }
34778 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
34779 DEBUG_FLOAT_ARRAY_DATA::ID => {
34780 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
34781 }
34782 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
34783 DISTANCE_SENSOR_DATA::ID => {
34784 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
34785 }
34786 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
34787 ENCAPSULATED_DATA_DATA::ID => {
34788 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
34789 }
34790 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
34791 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
34792 ESTIMATOR_STATUS_DATA::ID => {
34793 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
34794 }
34795 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
34796 EXTENDED_SYS_STATE_DATA::ID => {
34797 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
34798 }
34799 FENCE_STATUS_DATA::ID => {
34800 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
34801 }
34802 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
34803 .map(Self::FILE_TRANSFER_PROTOCOL),
34804 FLIGHT_INFORMATION_DATA::ID => {
34805 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
34806 }
34807 FOLLOW_TARGET_DATA::ID => {
34808 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
34809 }
34810 FUEL_STATUS_DATA::ID => {
34811 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
34812 }
34813 GENERATOR_STATUS_DATA::ID => {
34814 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
34815 }
34816 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
34817 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
34818 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
34819 }
34820 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
34821 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
34822 .map(Self::GIMBAL_DEVICE_INFORMATION)
34823 }
34824 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
34825 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
34826 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
34827 }
34828 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
34829 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
34830 .map(Self::GIMBAL_MANAGER_INFORMATION)
34831 }
34832 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
34833 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
34834 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
34835 }
34836 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34837 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
34838 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
34839 }
34840 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
34841 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
34842 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
34843 }
34844 GIMBAL_MANAGER_STATUS_DATA::ID => {
34845 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
34846 }
34847 GLOBAL_POSITION_INT_DATA::ID => {
34848 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
34849 }
34850 GLOBAL_POSITION_INT_COV_DATA::ID => {
34851 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
34852 .map(Self::GLOBAL_POSITION_INT_COV)
34853 }
34854 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34855 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34856 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
34857 }
34858 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
34859 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
34860 GPS_GLOBAL_ORIGIN_DATA::ID => {
34861 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
34862 }
34863 GPS_INJECT_DATA_DATA::ID => {
34864 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
34865 }
34866 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
34867 GPS_RAW_INT_DATA::ID => {
34868 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
34869 }
34870 GPS_RTCM_DATA_DATA::ID => {
34871 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
34872 }
34873 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
34874 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
34875 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
34876 HIGHRES_IMU_DATA::ID => {
34877 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
34878 }
34879 HIGH_LATENCY_DATA::ID => {
34880 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
34881 }
34882 HIGH_LATENCY2_DATA::ID => {
34883 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
34884 }
34885 HIL_ACTUATOR_CONTROLS_DATA::ID => {
34886 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
34887 }
34888 HIL_CONTROLS_DATA::ID => {
34889 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
34890 }
34891 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
34892 HIL_OPTICAL_FLOW_DATA::ID => {
34893 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
34894 }
34895 HIL_RC_INPUTS_RAW_DATA::ID => {
34896 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
34897 }
34898 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
34899 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
34900 HIL_STATE_QUATERNION_DATA::ID => {
34901 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
34902 }
34903 HOME_POSITION_DATA::ID => {
34904 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
34905 }
34906 HYGROMETER_SENSOR_DATA::ID => {
34907 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
34908 }
34909 ILLUMINATOR_STATUS_DATA::ID => {
34910 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
34911 }
34912 ISBD_LINK_STATUS_DATA::ID => {
34913 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
34914 }
34915 LANDING_TARGET_DATA::ID => {
34916 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
34917 }
34918 LINK_NODE_STATUS_DATA::ID => {
34919 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
34920 }
34921 LOCAL_POSITION_NED_DATA::ID => {
34922 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
34923 }
34924 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
34925 .map(Self::LOCAL_POSITION_NED_COV),
34926 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34927 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
34928 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
34929 }
34930 LOGGING_ACK_DATA::ID => {
34931 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
34932 }
34933 LOGGING_DATA_DATA::ID => {
34934 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
34935 }
34936 LOGGING_DATA_ACKED_DATA::ID => {
34937 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
34938 }
34939 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
34940 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
34941 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
34942 LOG_REQUEST_DATA_DATA::ID => {
34943 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
34944 }
34945 LOG_REQUEST_END_DATA::ID => {
34946 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
34947 }
34948 LOG_REQUEST_LIST_DATA::ID => {
34949 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
34950 }
34951 MAG_CAL_REPORT_DATA::ID => {
34952 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
34953 }
34954 MANUAL_CONTROL_DATA::ID => {
34955 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
34956 }
34957 MANUAL_SETPOINT_DATA::ID => {
34958 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
34959 }
34960 MEMORY_VECT_DATA::ID => {
34961 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
34962 }
34963 MESSAGE_INTERVAL_DATA::ID => {
34964 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
34965 }
34966 MISSION_ACK_DATA::ID => {
34967 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
34968 }
34969 MISSION_CLEAR_ALL_DATA::ID => {
34970 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
34971 }
34972 MISSION_COUNT_DATA::ID => {
34973 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
34974 }
34975 MISSION_CURRENT_DATA::ID => {
34976 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
34977 }
34978 MISSION_ITEM_DATA::ID => {
34979 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
34980 }
34981 MISSION_ITEM_INT_DATA::ID => {
34982 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
34983 }
34984 MISSION_ITEM_REACHED_DATA::ID => {
34985 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
34986 }
34987 MISSION_REQUEST_DATA::ID => {
34988 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
34989 }
34990 MISSION_REQUEST_INT_DATA::ID => {
34991 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
34992 }
34993 MISSION_REQUEST_LIST_DATA::ID => {
34994 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
34995 }
34996 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
34997 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
34998 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
34999 }
35000 MISSION_SET_CURRENT_DATA::ID => {
35001 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
35002 }
35003 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
35004 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
35005 .map(Self::MISSION_WRITE_PARTIAL_LIST)
35006 }
35007 MOUNT_ORIENTATION_DATA::ID => {
35008 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
35009 }
35010 NAMED_VALUE_FLOAT_DATA::ID => {
35011 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
35012 }
35013 NAMED_VALUE_INT_DATA::ID => {
35014 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
35015 }
35016 NAV_CONTROLLER_OUTPUT_DATA::ID => {
35017 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
35018 }
35019 OBSTACLE_DISTANCE_DATA::ID => {
35020 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
35021 }
35022 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
35023 ONBOARD_COMPUTER_STATUS_DATA::ID => {
35024 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
35025 .map(Self::ONBOARD_COMPUTER_STATUS)
35026 }
35027 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
35028 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
35029 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
35030 }
35031 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
35032 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
35033 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
35034 }
35035 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
35036 .map(Self::OPEN_DRONE_ID_BASIC_ID),
35037 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
35038 .map(Self::OPEN_DRONE_ID_LOCATION),
35039 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
35040 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
35041 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
35042 }
35043 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
35044 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
35045 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
35046 }
35047 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
35048 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
35049 }
35050 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
35051 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
35052 }
35053 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
35054 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
35055 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
35056 }
35057 OPTICAL_FLOW_DATA::ID => {
35058 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
35059 }
35060 OPTICAL_FLOW_RAD_DATA::ID => {
35061 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
35062 }
35063 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
35064 .map(Self::ORBIT_EXECUTION_STATUS),
35065 PARAM_EXT_ACK_DATA::ID => {
35066 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
35067 }
35068 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
35069 .map(Self::PARAM_EXT_REQUEST_LIST),
35070 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
35071 .map(Self::PARAM_EXT_REQUEST_READ),
35072 PARAM_EXT_SET_DATA::ID => {
35073 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
35074 }
35075 PARAM_EXT_VALUE_DATA::ID => {
35076 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
35077 }
35078 PARAM_MAP_RC_DATA::ID => {
35079 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
35080 }
35081 PARAM_REQUEST_LIST_DATA::ID => {
35082 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
35083 }
35084 PARAM_REQUEST_READ_DATA::ID => {
35085 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
35086 }
35087 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
35088 PARAM_VALUE_DATA::ID => {
35089 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
35090 }
35091 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
35092 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
35093 PLAY_TUNE_V2_DATA::ID => {
35094 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
35095 }
35096 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35097 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35098 .map(Self::POSITION_TARGET_GLOBAL_INT)
35099 }
35100 POSITION_TARGET_LOCAL_NED_DATA::ID => {
35101 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35102 .map(Self::POSITION_TARGET_LOCAL_NED)
35103 }
35104 POWER_STATUS_DATA::ID => {
35105 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
35106 }
35107 PROTOCOL_VERSION_DATA::ID => {
35108 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
35109 }
35110 RADIO_STATUS_DATA::ID => {
35111 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
35112 }
35113 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
35114 RAW_PRESSURE_DATA::ID => {
35115 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
35116 }
35117 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
35118 RC_CHANNELS_DATA::ID => {
35119 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
35120 }
35121 RC_CHANNELS_OVERRIDE_DATA::ID => {
35122 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
35123 }
35124 RC_CHANNELS_RAW_DATA::ID => {
35125 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
35126 }
35127 RC_CHANNELS_SCALED_DATA::ID => {
35128 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
35129 }
35130 REQUEST_DATA_STREAM_DATA::ID => {
35131 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
35132 }
35133 REQUEST_EVENT_DATA::ID => {
35134 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
35135 }
35136 RESOURCE_REQUEST_DATA::ID => {
35137 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
35138 }
35139 RESPONSE_EVENT_ERROR_DATA::ID => {
35140 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
35141 }
35142 SAFETY_ALLOWED_AREA_DATA::ID => {
35143 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
35144 }
35145 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
35146 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
35147 .map(Self::SAFETY_SET_ALLOWED_AREA)
35148 }
35149 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
35150 SCALED_IMU2_DATA::ID => {
35151 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
35152 }
35153 SCALED_IMU3_DATA::ID => {
35154 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
35155 }
35156 SCALED_PRESSURE_DATA::ID => {
35157 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
35158 }
35159 SCALED_PRESSURE2_DATA::ID => {
35160 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
35161 }
35162 SCALED_PRESSURE3_DATA::ID => {
35163 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
35164 }
35165 SERIAL_CONTROL_DATA::ID => {
35166 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
35167 }
35168 SERVO_OUTPUT_RAW_DATA::ID => {
35169 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
35170 }
35171 SETUP_SIGNING_DATA::ID => {
35172 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
35173 }
35174 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
35175 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35176 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
35177 }
35178 SET_ATTITUDE_TARGET_DATA::ID => {
35179 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
35180 }
35181 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
35182 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
35183 }
35184 SET_HOME_POSITION_DATA::ID => {
35185 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
35186 }
35187 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
35188 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35189 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35190 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
35191 }
35192 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
35193 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35194 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
35195 }
35196 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
35197 SMART_BATTERY_INFO_DATA::ID => {
35198 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
35199 }
35200 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
35201 STORAGE_INFORMATION_DATA::ID => {
35202 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
35203 }
35204 SUPPORTED_TUNES_DATA::ID => {
35205 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
35206 }
35207 SYSTEM_TIME_DATA::ID => {
35208 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
35209 }
35210 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
35211 TERRAIN_CHECK_DATA::ID => {
35212 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
35213 }
35214 TERRAIN_DATA_DATA::ID => {
35215 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
35216 }
35217 TERRAIN_REPORT_DATA::ID => {
35218 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
35219 }
35220 TERRAIN_REQUEST_DATA::ID => {
35221 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
35222 }
35223 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
35224 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
35225 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
35226 .map(Self::TIME_ESTIMATE_TO_TARGET)
35227 }
35228 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35229 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
35230 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
35231 }
35232 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35233 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
35234 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
35235 }
35236 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
35237 UAVCAN_NODE_INFO_DATA::ID => {
35238 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
35239 }
35240 UAVCAN_NODE_STATUS_DATA::ID => {
35241 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
35242 }
35243 UAVIONIX_ADSB_GET_DATA::ID => {
35244 UAVIONIX_ADSB_GET_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_GET)
35245 }
35246 UAVIONIX_ADSB_OUT_CFG_DATA::ID => {
35247 UAVIONIX_ADSB_OUT_CFG_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_OUT_CFG)
35248 }
35249 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
35250 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::deser(version, payload)
35251 .map(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID)
35252 }
35253 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
35254 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::deser(version, payload)
35255 .map(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION)
35256 }
35257 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => {
35258 UAVIONIX_ADSB_OUT_CONTROL_DATA::deser(version, payload)
35259 .map(Self::UAVIONIX_ADSB_OUT_CONTROL)
35260 }
35261 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => {
35262 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::deser(version, payload)
35263 .map(Self::UAVIONIX_ADSB_OUT_DYNAMIC)
35264 }
35265 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => {
35266 UAVIONIX_ADSB_OUT_STATUS_DATA::deser(version, payload)
35267 .map(Self::UAVIONIX_ADSB_OUT_STATUS)
35268 }
35269 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
35270 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::deser(version, payload)
35271 .map(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT)
35272 }
35273 UTM_GLOBAL_POSITION_DATA::ID => {
35274 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
35275 }
35276 V2_EXTENSION_DATA::ID => {
35277 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
35278 }
35279 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
35280 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
35281 VICON_POSITION_ESTIMATE_DATA::ID => {
35282 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
35283 .map(Self::VICON_POSITION_ESTIMATE)
35284 }
35285 VIDEO_STREAM_INFORMATION_DATA::ID => {
35286 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
35287 .map(Self::VIDEO_STREAM_INFORMATION)
35288 }
35289 VIDEO_STREAM_STATUS_DATA::ID => {
35290 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
35291 }
35292 VISION_POSITION_ESTIMATE_DATA::ID => {
35293 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35294 .map(Self::VISION_POSITION_ESTIMATE)
35295 }
35296 VISION_SPEED_ESTIMATE_DATA::ID => {
35297 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
35298 }
35299 WHEEL_DISTANCE_DATA::ID => {
35300 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
35301 }
35302 WIFI_CONFIG_AP_DATA::ID => {
35303 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
35304 }
35305 WINCH_STATUS_DATA::ID => {
35306 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
35307 }
35308 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
35309 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
35310 }
35311 }
35312 fn message_name(&self) -> &'static str {
35313 match self {
35314 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
35315 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35316 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
35317 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
35318 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
35319 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
35320 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
35321 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
35322 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
35323 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
35324 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
35325 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35326 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
35327 }
35328 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
35329 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
35330 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
35331 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
35332 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
35333 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
35334 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
35335 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
35336 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
35337 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
35338 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
35339 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
35340 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
35341 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
35342 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
35343 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
35344 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
35345 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
35346 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
35347 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
35348 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
35349 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
35350 Self::COLLISION(..) => COLLISION_DATA::NAME,
35351 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
35352 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
35353 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
35354 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
35355 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
35356 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
35357 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
35358 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
35359 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
35360 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
35361 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
35362 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
35363 Self::DEBUG(..) => DEBUG_DATA::NAME,
35364 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
35365 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
35366 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
35367 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
35368 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
35369 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
35370 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
35371 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
35372 Self::EVENT(..) => EVENT_DATA::NAME,
35373 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
35374 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
35375 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
35376 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
35377 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
35378 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
35379 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
35380 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
35381 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
35382 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
35383 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
35384 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
35385 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
35386 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
35387 }
35388 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
35389 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
35390 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
35391 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
35392 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
35393 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
35394 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
35395 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
35396 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
35397 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
35398 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
35399 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
35400 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
35401 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
35402 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
35403 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
35404 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
35405 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
35406 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
35407 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
35408 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
35409 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
35410 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
35411 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
35412 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
35413 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
35414 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
35415 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
35416 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
35417 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
35418 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
35419 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
35420 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
35421 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
35422 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
35423 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
35424 }
35425 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
35426 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
35427 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
35428 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
35429 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
35430 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
35431 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
35432 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
35433 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
35434 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
35435 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
35436 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
35437 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
35438 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
35439 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
35440 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
35441 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
35442 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
35443 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
35444 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
35445 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
35446 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
35447 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
35448 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
35449 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
35450 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
35451 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
35452 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
35453 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
35454 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
35455 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
35456 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
35457 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
35458 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
35459 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
35460 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
35461 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
35462 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
35463 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
35464 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
35465 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
35466 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
35467 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
35468 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
35469 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
35470 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
35471 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
35472 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
35473 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
35474 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
35475 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
35476 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
35477 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
35478 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
35479 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
35480 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
35481 Self::PING(..) => PING_DATA::NAME,
35482 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
35483 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
35484 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35485 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
35486 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
35487 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
35488 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
35489 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
35490 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
35491 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
35492 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
35493 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
35494 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
35495 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
35496 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
35497 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
35498 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
35499 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
35500 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
35501 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
35502 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
35503 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
35504 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
35505 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
35506 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
35507 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
35508 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
35509 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
35510 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
35511 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
35512 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
35513 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
35514 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
35515 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
35516 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35517 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
35518 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
35519 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
35520 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
35521 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
35522 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
35523 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
35524 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
35525 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
35526 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
35527 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
35528 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
35529 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
35530 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
35531 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
35532 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
35533 }
35534 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
35535 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
35536 }
35537 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
35538 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
35539 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
35540 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::NAME,
35541 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::NAME,
35542 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME,
35543 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
35544 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME
35545 }
35546 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME,
35547 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME,
35548 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::NAME,
35549 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
35550 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME
35551 }
35552 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
35553 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
35554 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
35555 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
35556 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
35557 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
35558 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
35559 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
35560 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
35561 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
35562 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
35563 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
35564 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
35565 }
35566 }
35567 fn message_id(&self) -> u32 {
35568 match self {
35569 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
35570 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
35571 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
35572 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
35573 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
35574 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
35575 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
35576 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
35577 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
35578 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
35579 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
35580 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35581 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
35582 }
35583 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
35584 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
35585 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
35586 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
35587 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
35588 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
35589 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
35590 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
35591 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
35592 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
35593 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
35594 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
35595 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
35596 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
35597 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
35598 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
35599 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
35600 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
35601 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
35602 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
35603 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
35604 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
35605 Self::COLLISION(..) => COLLISION_DATA::ID,
35606 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
35607 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
35608 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
35609 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
35610 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
35611 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
35612 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
35613 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
35614 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
35615 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
35616 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
35617 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
35618 Self::DEBUG(..) => DEBUG_DATA::ID,
35619 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
35620 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
35621 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
35622 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
35623 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
35624 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
35625 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
35626 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
35627 Self::EVENT(..) => EVENT_DATA::ID,
35628 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
35629 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
35630 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
35631 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
35632 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
35633 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
35634 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
35635 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
35636 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
35637 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
35638 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
35639 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
35640 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
35641 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
35642 }
35643 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
35644 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
35645 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
35646 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
35647 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
35648 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
35649 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
35650 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
35651 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
35652 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
35653 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
35654 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
35655 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
35656 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
35657 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
35658 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
35659 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
35660 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
35661 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
35662 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
35663 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
35664 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
35665 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
35666 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
35667 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
35668 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
35669 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
35670 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
35671 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
35672 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
35673 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
35674 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
35675 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
35676 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
35677 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
35678 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
35679 }
35680 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
35681 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
35682 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
35683 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
35684 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
35685 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
35686 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
35687 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
35688 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
35689 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
35690 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
35691 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
35692 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
35693 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
35694 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
35695 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
35696 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
35697 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
35698 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
35699 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
35700 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
35701 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
35702 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
35703 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
35704 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
35705 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
35706 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
35707 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
35708 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
35709 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
35710 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
35711 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
35712 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
35713 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
35714 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
35715 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
35716 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
35717 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
35718 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
35719 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
35720 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
35721 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
35722 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
35723 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
35724 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
35725 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
35726 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
35727 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
35728 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
35729 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
35730 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
35731 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
35732 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
35733 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
35734 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
35735 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
35736 Self::PING(..) => PING_DATA::ID,
35737 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
35738 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
35739 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
35740 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
35741 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
35742 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
35743 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
35744 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
35745 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
35746 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
35747 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
35748 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
35749 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
35750 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
35751 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
35752 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
35753 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
35754 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
35755 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
35756 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
35757 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
35758 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
35759 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
35760 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
35761 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
35762 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
35763 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
35764 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
35765 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
35766 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
35767 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
35768 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
35769 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
35770 Self::SET_MODE(..) => SET_MODE_DATA::ID,
35771 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
35772 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
35773 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
35774 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
35775 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
35776 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
35777 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
35778 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
35779 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
35780 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
35781 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
35782 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
35783 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
35784 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
35785 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
35786 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
35787 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
35788 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
35789 }
35790 Self::TUNNEL(..) => TUNNEL_DATA::ID,
35791 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
35792 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
35793 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::ID,
35794 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::ID,
35795 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID,
35796 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
35797 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID
35798 }
35799 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::ID,
35800 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID,
35801 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::ID,
35802 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
35803 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID
35804 }
35805 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
35806 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
35807 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
35808 Self::VIBRATION(..) => VIBRATION_DATA::ID,
35809 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
35810 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
35811 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
35812 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
35813 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
35814 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
35815 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
35816 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
35817 Self::WIND_COV(..) => WIND_COV_DATA::ID,
35818 }
35819 }
35820 fn message_id_from_name(name: &str) -> Option<u32> {
35821 match name {
35822 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
35823 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
35824 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
35825 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
35826 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
35827 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
35828 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
35829 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
35830 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
35831 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
35832 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
35833 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
35834 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
35835 }
35836 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
35837 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
35838 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
35839 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
35840 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
35841 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
35842 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
35843 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
35844 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
35845 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
35846 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
35847 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
35848 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
35849 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
35850 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
35851 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
35852 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
35853 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
35854 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
35855 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
35856 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
35857 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
35858 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
35859 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
35860 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
35861 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
35862 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
35863 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
35864 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
35865 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
35866 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
35867 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
35868 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
35869 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
35870 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
35871 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
35872 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
35873 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
35874 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
35875 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
35876 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
35877 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
35878 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
35879 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
35880 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
35881 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
35882 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
35883 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
35884 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
35885 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
35886 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
35887 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
35888 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
35889 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
35890 }
35891 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
35892 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
35893 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
35894 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
35895 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
35896 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
35897 }
35898 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
35899 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
35900 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
35901 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
35902 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
35903 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
35904 }
35905 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
35906 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
35907 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
35908 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
35909 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
35910 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
35911 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
35912 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
35913 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
35914 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
35915 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
35916 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
35917 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
35918 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
35919 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
35920 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
35921 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
35922 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
35923 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
35924 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
35925 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
35926 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
35927 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
35928 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
35929 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
35930 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
35931 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
35932 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
35933 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
35934 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
35935 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
35936 }
35937 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
35938 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
35939 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
35940 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
35941 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
35942 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
35943 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
35944 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
35945 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
35946 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
35947 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
35948 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
35949 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
35950 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
35951 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
35952 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
35953 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
35954 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
35955 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
35956 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
35957 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
35958 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
35959 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
35960 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
35961 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
35962 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
35963 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
35964 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
35965 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
35966 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
35967 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
35968 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
35969 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
35970 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
35971 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
35972 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
35973 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
35974 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
35975 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
35976 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
35977 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
35978 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
35979 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
35980 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
35981 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
35982 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
35983 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
35984 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
35985 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
35986 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
35987 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
35988 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
35989 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
35990 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
35991 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
35992 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
35993 PING_DATA::NAME => Some(PING_DATA::ID),
35994 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
35995 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
35996 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
35997 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
35998 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
35999 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
36000 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
36001 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
36002 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
36003 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
36004 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
36005 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
36006 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
36007 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
36008 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
36009 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
36010 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
36011 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
36012 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
36013 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
36014 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
36015 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
36016 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
36017 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
36018 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
36019 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
36020 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
36021 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
36022 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
36023 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
36024 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
36025 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
36026 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
36027 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
36028 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
36029 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
36030 }
36031 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
36032 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
36033 }
36034 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
36035 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
36036 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
36037 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
36038 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
36039 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
36040 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
36041 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
36042 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
36043 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
36044 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
36045 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
36046 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
36047 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
36048 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
36049 }
36050 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
36051 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
36052 }
36053 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
36054 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
36055 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
36056 UAVIONIX_ADSB_GET_DATA::NAME => Some(UAVIONIX_ADSB_GET_DATA::ID),
36057 UAVIONIX_ADSB_OUT_CFG_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CFG_DATA::ID),
36058 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME => {
36059 Some(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID)
36060 }
36061 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME => {
36062 Some(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID)
36063 }
36064 UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CONTROL_DATA::ID),
36065 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME => Some(UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID),
36066 UAVIONIX_ADSB_OUT_STATUS_DATA::NAME => Some(UAVIONIX_ADSB_OUT_STATUS_DATA::ID),
36067 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME => {
36068 Some(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID)
36069 }
36070 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
36071 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
36072 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
36073 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
36074 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
36075 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
36076 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
36077 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
36078 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
36079 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
36080 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
36081 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
36082 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
36083 _ => None,
36084 }
36085 }
36086 fn default_message_from_id(id: u32) -> Option<Self> {
36087 match id {
36088 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
36089 ACTUATOR_CONTROL_TARGET_DATA::default(),
36090 )),
36091 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
36092 ACTUATOR_OUTPUT_STATUS_DATA::default(),
36093 )),
36094 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
36095 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
36096 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
36097 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
36098 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
36099 ATTITUDE_QUATERNION_DATA::default(),
36100 )),
36101 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
36102 ATTITUDE_QUATERNION_COV_DATA::default(),
36103 )),
36104 ATTITUDE_TARGET_DATA::ID => {
36105 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
36106 }
36107 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
36108 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
36109 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36110 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
36111 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
36112 ))
36113 }
36114 AUTOPILOT_VERSION_DATA::ID => {
36115 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
36116 }
36117 AVAILABLE_MODES_DATA::ID => {
36118 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
36119 }
36120 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
36121 AVAILABLE_MODES_MONITOR_DATA::default(),
36122 )),
36123 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
36124 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
36125 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
36126 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
36127 CAMERA_CAPTURE_STATUS_DATA::default(),
36128 )),
36129 CAMERA_FOV_STATUS_DATA::ID => {
36130 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
36131 }
36132 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
36133 CAMERA_IMAGE_CAPTURED_DATA::default(),
36134 )),
36135 CAMERA_INFORMATION_DATA::ID => {
36136 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
36137 }
36138 CAMERA_SETTINGS_DATA::ID => {
36139 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
36140 }
36141 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
36142 CAMERA_THERMAL_RANGE_DATA::default(),
36143 )),
36144 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
36145 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
36146 )),
36147 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
36148 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
36149 )),
36150 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
36151 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
36152 CAN_FILTER_MODIFY_DATA::ID => {
36153 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
36154 }
36155 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
36156 CELLULAR_CONFIG_DATA::ID => {
36157 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
36158 }
36159 CELLULAR_STATUS_DATA::ID => {
36160 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
36161 }
36162 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
36163 CHANGE_OPERATOR_CONTROL_DATA::default(),
36164 )),
36165 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
36166 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
36167 )),
36168 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
36169 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
36170 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
36171 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
36172 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
36173 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
36174 COMPONENT_INFORMATION_DATA::default(),
36175 )),
36176 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
36177 COMPONENT_INFORMATION_BASIC_DATA::default(),
36178 )),
36179 COMPONENT_METADATA_DATA::ID => {
36180 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
36181 }
36182 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
36183 CONTROL_SYSTEM_STATE_DATA::default(),
36184 )),
36185 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
36186 CURRENT_EVENT_SEQUENCE_DATA::default(),
36187 )),
36188 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
36189 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
36190 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
36191 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
36192 )),
36193 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
36194 DEBUG_FLOAT_ARRAY_DATA::ID => {
36195 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
36196 }
36197 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
36198 DISTANCE_SENSOR_DATA::ID => {
36199 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
36200 }
36201 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
36202 ENCAPSULATED_DATA_DATA::ID => {
36203 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
36204 }
36205 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
36206 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
36207 ESTIMATOR_STATUS_DATA::ID => {
36208 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
36209 }
36210 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
36211 EXTENDED_SYS_STATE_DATA::ID => {
36212 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
36213 }
36214 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
36215 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36216 FILE_TRANSFER_PROTOCOL_DATA::default(),
36217 )),
36218 FLIGHT_INFORMATION_DATA::ID => {
36219 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
36220 }
36221 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
36222 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
36223 GENERATOR_STATUS_DATA::ID => {
36224 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
36225 }
36226 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36227 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
36228 )),
36229 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36230 GIMBAL_DEVICE_INFORMATION_DATA::default(),
36231 )),
36232 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36233 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
36234 )),
36235 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36236 GIMBAL_MANAGER_INFORMATION_DATA::default(),
36237 )),
36238 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36239 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
36240 )),
36241 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36242 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36243 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
36244 ))
36245 }
36246 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36247 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
36248 )),
36249 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36250 GIMBAL_MANAGER_STATUS_DATA::default(),
36251 )),
36252 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36253 GLOBAL_POSITION_INT_DATA::default(),
36254 )),
36255 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36256 GLOBAL_POSITION_INT_COV_DATA::default(),
36257 )),
36258 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36259 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36260 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
36261 ))
36262 }
36263 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
36264 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
36265 GPS_GLOBAL_ORIGIN_DATA::ID => {
36266 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
36267 }
36268 GPS_INJECT_DATA_DATA::ID => {
36269 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
36270 }
36271 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
36272 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
36273 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
36274 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
36275 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
36276 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
36277 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
36278 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
36279 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
36280 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36281 HIL_ACTUATOR_CONTROLS_DATA::default(),
36282 )),
36283 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
36284 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
36285 HIL_OPTICAL_FLOW_DATA::ID => {
36286 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
36287 }
36288 HIL_RC_INPUTS_RAW_DATA::ID => {
36289 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
36290 }
36291 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
36292 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
36293 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36294 HIL_STATE_QUATERNION_DATA::default(),
36295 )),
36296 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
36297 HYGROMETER_SENSOR_DATA::ID => {
36298 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
36299 }
36300 ILLUMINATOR_STATUS_DATA::ID => {
36301 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
36302 }
36303 ISBD_LINK_STATUS_DATA::ID => {
36304 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
36305 }
36306 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
36307 LINK_NODE_STATUS_DATA::ID => {
36308 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
36309 }
36310 LOCAL_POSITION_NED_DATA::ID => {
36311 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
36312 }
36313 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36314 LOCAL_POSITION_NED_COV_DATA::default(),
36315 )),
36316 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36317 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36318 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
36319 ))
36320 }
36321 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
36322 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
36323 LOGGING_DATA_ACKED_DATA::ID => {
36324 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
36325 }
36326 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
36327 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
36328 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
36329 LOG_REQUEST_DATA_DATA::ID => {
36330 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
36331 }
36332 LOG_REQUEST_END_DATA::ID => {
36333 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
36334 }
36335 LOG_REQUEST_LIST_DATA::ID => {
36336 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
36337 }
36338 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
36339 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
36340 MANUAL_SETPOINT_DATA::ID => {
36341 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
36342 }
36343 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
36344 MESSAGE_INTERVAL_DATA::ID => {
36345 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
36346 }
36347 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
36348 MISSION_CLEAR_ALL_DATA::ID => {
36349 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
36350 }
36351 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
36352 MISSION_CURRENT_DATA::ID => {
36353 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
36354 }
36355 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
36356 MISSION_ITEM_INT_DATA::ID => {
36357 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
36358 }
36359 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36360 MISSION_ITEM_REACHED_DATA::default(),
36361 )),
36362 MISSION_REQUEST_DATA::ID => {
36363 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
36364 }
36365 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36366 MISSION_REQUEST_INT_DATA::default(),
36367 )),
36368 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36369 MISSION_REQUEST_LIST_DATA::default(),
36370 )),
36371 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36372 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
36373 )),
36374 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36375 MISSION_SET_CURRENT_DATA::default(),
36376 )),
36377 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36378 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
36379 )),
36380 MOUNT_ORIENTATION_DATA::ID => {
36381 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
36382 }
36383 NAMED_VALUE_FLOAT_DATA::ID => {
36384 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
36385 }
36386 NAMED_VALUE_INT_DATA::ID => {
36387 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
36388 }
36389 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36390 NAV_CONTROLLER_OUTPUT_DATA::default(),
36391 )),
36392 OBSTACLE_DISTANCE_DATA::ID => {
36393 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
36394 }
36395 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
36396 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36397 ONBOARD_COMPUTER_STATUS_DATA::default(),
36398 )),
36399 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36400 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
36401 )),
36402 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36403 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
36404 )),
36405 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36406 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
36407 )),
36408 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36409 OPEN_DRONE_ID_LOCATION_DATA::default(),
36410 )),
36411 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36412 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
36413 )),
36414 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36415 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
36416 )),
36417 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36418 OPEN_DRONE_ID_SELF_ID_DATA::default(),
36419 )),
36420 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36421 OPEN_DRONE_ID_SYSTEM_DATA::default(),
36422 )),
36423 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36424 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
36425 )),
36426 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
36427 OPTICAL_FLOW_RAD_DATA::ID => {
36428 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
36429 }
36430 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36431 ORBIT_EXECUTION_STATUS_DATA::default(),
36432 )),
36433 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
36434 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36435 PARAM_EXT_REQUEST_LIST_DATA::default(),
36436 )),
36437 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36438 PARAM_EXT_REQUEST_READ_DATA::default(),
36439 )),
36440 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
36441 PARAM_EXT_VALUE_DATA::ID => {
36442 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
36443 }
36444 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
36445 PARAM_REQUEST_LIST_DATA::ID => {
36446 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
36447 }
36448 PARAM_REQUEST_READ_DATA::ID => {
36449 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
36450 }
36451 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
36452 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
36453 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
36454 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
36455 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
36456 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36457 POSITION_TARGET_GLOBAL_INT_DATA::default(),
36458 )),
36459 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36460 POSITION_TARGET_LOCAL_NED_DATA::default(),
36461 )),
36462 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
36463 PROTOCOL_VERSION_DATA::ID => {
36464 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
36465 }
36466 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
36467 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
36468 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
36469 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
36470 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
36471 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36472 RC_CHANNELS_OVERRIDE_DATA::default(),
36473 )),
36474 RC_CHANNELS_RAW_DATA::ID => {
36475 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
36476 }
36477 RC_CHANNELS_SCALED_DATA::ID => {
36478 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
36479 }
36480 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36481 REQUEST_DATA_STREAM_DATA::default(),
36482 )),
36483 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
36484 RESOURCE_REQUEST_DATA::ID => {
36485 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
36486 }
36487 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36488 RESPONSE_EVENT_ERROR_DATA::default(),
36489 )),
36490 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36491 SAFETY_ALLOWED_AREA_DATA::default(),
36492 )),
36493 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36494 SAFETY_SET_ALLOWED_AREA_DATA::default(),
36495 )),
36496 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
36497 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
36498 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
36499 SCALED_PRESSURE_DATA::ID => {
36500 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
36501 }
36502 SCALED_PRESSURE2_DATA::ID => {
36503 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
36504 }
36505 SCALED_PRESSURE3_DATA::ID => {
36506 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
36507 }
36508 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
36509 SERVO_OUTPUT_RAW_DATA::ID => {
36510 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
36511 }
36512 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
36513 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36514 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
36515 )),
36516 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36517 SET_ATTITUDE_TARGET_DATA::default(),
36518 )),
36519 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36520 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
36521 )),
36522 SET_HOME_POSITION_DATA::ID => {
36523 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
36524 }
36525 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
36526 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36527 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
36528 )),
36529 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36530 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
36531 )),
36532 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
36533 SMART_BATTERY_INFO_DATA::ID => {
36534 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
36535 }
36536 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
36537 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36538 STORAGE_INFORMATION_DATA::default(),
36539 )),
36540 SUPPORTED_TUNES_DATA::ID => {
36541 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
36542 }
36543 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
36544 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
36545 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
36546 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
36547 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
36548 TERRAIN_REQUEST_DATA::ID => {
36549 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
36550 }
36551 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
36552 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36553 TIME_ESTIMATE_TO_TARGET_DATA::default(),
36554 )),
36555 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36556 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36557 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
36558 ))
36559 }
36560 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36561 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36562 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
36563 ))
36564 }
36565 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
36566 UAVCAN_NODE_INFO_DATA::ID => {
36567 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
36568 }
36569 UAVCAN_NODE_STATUS_DATA::ID => {
36570 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
36571 }
36572 UAVIONIX_ADSB_GET_DATA::ID => {
36573 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::default()))
36574 }
36575 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
36576 UAVIONIX_ADSB_OUT_CFG_DATA::default(),
36577 )),
36578 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
36579 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::default(),
36580 )),
36581 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
36582 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
36583 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::default(),
36584 ))
36585 }
36586 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
36587 UAVIONIX_ADSB_OUT_CONTROL_DATA::default(),
36588 )),
36589 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
36590 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::default(),
36591 )),
36592 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
36593 UAVIONIX_ADSB_OUT_STATUS_DATA::default(),
36594 )),
36595 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
36596 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
36597 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::default(),
36598 ))
36599 }
36600 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36601 UTM_GLOBAL_POSITION_DATA::default(),
36602 )),
36603 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
36604 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
36605 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
36606 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36607 VICON_POSITION_ESTIMATE_DATA::default(),
36608 )),
36609 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36610 VIDEO_STREAM_INFORMATION_DATA::default(),
36611 )),
36612 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36613 VIDEO_STREAM_STATUS_DATA::default(),
36614 )),
36615 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36616 VISION_POSITION_ESTIMATE_DATA::default(),
36617 )),
36618 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36619 VISION_SPEED_ESTIMATE_DATA::default(),
36620 )),
36621 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
36622 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
36623 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
36624 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
36625 _ => None,
36626 }
36627 }
36628 #[cfg(feature = "arbitrary")]
36629 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
36630 match id {
36631 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
36632 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36633 )),
36634 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
36635 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
36636 )),
36637 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
36638 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
36639 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
36640 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
36641 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
36642 ATTITUDE_QUATERNION_DATA::random(rng),
36643 )),
36644 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
36645 ATTITUDE_QUATERNION_COV_DATA::random(rng),
36646 )),
36647 ATTITUDE_TARGET_DATA::ID => {
36648 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
36649 }
36650 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
36651 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
36652 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36653 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
36654 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
36655 ))
36656 }
36657 AUTOPILOT_VERSION_DATA::ID => {
36658 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
36659 }
36660 AVAILABLE_MODES_DATA::ID => {
36661 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
36662 }
36663 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
36664 AVAILABLE_MODES_MONITOR_DATA::random(rng),
36665 )),
36666 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
36667 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
36668 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
36669 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
36670 CAMERA_CAPTURE_STATUS_DATA::random(rng),
36671 )),
36672 CAMERA_FOV_STATUS_DATA::ID => {
36673 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
36674 }
36675 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
36676 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
36677 )),
36678 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
36679 CAMERA_INFORMATION_DATA::random(rng),
36680 )),
36681 CAMERA_SETTINGS_DATA::ID => {
36682 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
36683 }
36684 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
36685 CAMERA_THERMAL_RANGE_DATA::random(rng),
36686 )),
36687 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
36688 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
36689 )),
36690 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
36691 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
36692 )),
36693 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
36694 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
36695 CAN_FILTER_MODIFY_DATA::ID => {
36696 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
36697 }
36698 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
36699 CELLULAR_CONFIG_DATA::ID => {
36700 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
36701 }
36702 CELLULAR_STATUS_DATA::ID => {
36703 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
36704 }
36705 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
36706 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
36707 )),
36708 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
36709 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
36710 )),
36711 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
36712 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
36713 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
36714 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
36715 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
36716 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
36717 COMPONENT_INFORMATION_DATA::random(rng),
36718 )),
36719 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
36720 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
36721 )),
36722 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
36723 COMPONENT_METADATA_DATA::random(rng),
36724 )),
36725 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
36726 CONTROL_SYSTEM_STATE_DATA::random(rng),
36727 )),
36728 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
36729 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
36730 )),
36731 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
36732 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
36733 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
36734 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
36735 )),
36736 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
36737 DEBUG_FLOAT_ARRAY_DATA::ID => {
36738 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
36739 }
36740 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
36741 DISTANCE_SENSOR_DATA::ID => {
36742 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
36743 }
36744 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
36745 ENCAPSULATED_DATA_DATA::ID => {
36746 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
36747 }
36748 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
36749 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
36750 ESTIMATOR_STATUS_DATA::ID => {
36751 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
36752 }
36753 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
36754 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
36755 EXTENDED_SYS_STATE_DATA::random(rng),
36756 )),
36757 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
36758 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36759 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
36760 )),
36761 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
36762 FLIGHT_INFORMATION_DATA::random(rng),
36763 )),
36764 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
36765 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
36766 GENERATOR_STATUS_DATA::ID => {
36767 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
36768 }
36769 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36770 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
36771 )),
36772 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36773 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
36774 )),
36775 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36776 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
36777 )),
36778 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36779 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
36780 )),
36781 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36782 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
36783 )),
36784 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36785 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36786 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
36787 ))
36788 }
36789 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36790 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
36791 )),
36792 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36793 GIMBAL_MANAGER_STATUS_DATA::random(rng),
36794 )),
36795 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36796 GLOBAL_POSITION_INT_DATA::random(rng),
36797 )),
36798 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36799 GLOBAL_POSITION_INT_COV_DATA::random(rng),
36800 )),
36801 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36802 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36803 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
36804 ))
36805 }
36806 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
36807 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
36808 GPS_GLOBAL_ORIGIN_DATA::ID => {
36809 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
36810 }
36811 GPS_INJECT_DATA_DATA::ID => {
36812 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
36813 }
36814 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
36815 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
36816 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
36817 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
36818 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
36819 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
36820 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
36821 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
36822 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
36823 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36824 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
36825 )),
36826 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
36827 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
36828 HIL_OPTICAL_FLOW_DATA::ID => {
36829 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
36830 }
36831 HIL_RC_INPUTS_RAW_DATA::ID => {
36832 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
36833 }
36834 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
36835 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
36836 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36837 HIL_STATE_QUATERNION_DATA::random(rng),
36838 )),
36839 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
36840 HYGROMETER_SENSOR_DATA::ID => {
36841 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
36842 }
36843 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
36844 ILLUMINATOR_STATUS_DATA::random(rng),
36845 )),
36846 ISBD_LINK_STATUS_DATA::ID => {
36847 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
36848 }
36849 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
36850 LINK_NODE_STATUS_DATA::ID => {
36851 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
36852 }
36853 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
36854 LOCAL_POSITION_NED_DATA::random(rng),
36855 )),
36856 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36857 LOCAL_POSITION_NED_COV_DATA::random(rng),
36858 )),
36859 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36860 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36861 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
36862 ))
36863 }
36864 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
36865 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
36866 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
36867 LOGGING_DATA_ACKED_DATA::random(rng),
36868 )),
36869 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
36870 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
36871 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
36872 LOG_REQUEST_DATA_DATA::ID => {
36873 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
36874 }
36875 LOG_REQUEST_END_DATA::ID => {
36876 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
36877 }
36878 LOG_REQUEST_LIST_DATA::ID => {
36879 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
36880 }
36881 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
36882 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
36883 MANUAL_SETPOINT_DATA::ID => {
36884 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
36885 }
36886 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
36887 MESSAGE_INTERVAL_DATA::ID => {
36888 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
36889 }
36890 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
36891 MISSION_CLEAR_ALL_DATA::ID => {
36892 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
36893 }
36894 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
36895 MISSION_CURRENT_DATA::ID => {
36896 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
36897 }
36898 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
36899 MISSION_ITEM_INT_DATA::ID => {
36900 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
36901 }
36902 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36903 MISSION_ITEM_REACHED_DATA::random(rng),
36904 )),
36905 MISSION_REQUEST_DATA::ID => {
36906 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
36907 }
36908 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36909 MISSION_REQUEST_INT_DATA::random(rng),
36910 )),
36911 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36912 MISSION_REQUEST_LIST_DATA::random(rng),
36913 )),
36914 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36915 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
36916 )),
36917 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36918 MISSION_SET_CURRENT_DATA::random(rng),
36919 )),
36920 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36921 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
36922 )),
36923 MOUNT_ORIENTATION_DATA::ID => {
36924 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
36925 }
36926 NAMED_VALUE_FLOAT_DATA::ID => {
36927 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
36928 }
36929 NAMED_VALUE_INT_DATA::ID => {
36930 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
36931 }
36932 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36933 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
36934 )),
36935 OBSTACLE_DISTANCE_DATA::ID => {
36936 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
36937 }
36938 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
36939 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36940 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
36941 )),
36942 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36943 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
36944 )),
36945 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36946 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
36947 )),
36948 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36949 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
36950 )),
36951 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36952 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
36953 )),
36954 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36955 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
36956 )),
36957 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36958 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
36959 )),
36960 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36961 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
36962 )),
36963 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36964 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
36965 )),
36966 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36967 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
36968 )),
36969 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
36970 OPTICAL_FLOW_RAD_DATA::ID => {
36971 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
36972 }
36973 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36974 ORBIT_EXECUTION_STATUS_DATA::random(rng),
36975 )),
36976 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
36977 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36978 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
36979 )),
36980 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36981 PARAM_EXT_REQUEST_READ_DATA::random(rng),
36982 )),
36983 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
36984 PARAM_EXT_VALUE_DATA::ID => {
36985 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
36986 }
36987 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
36988 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
36989 PARAM_REQUEST_LIST_DATA::random(rng),
36990 )),
36991 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
36992 PARAM_REQUEST_READ_DATA::random(rng),
36993 )),
36994 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
36995 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
36996 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
36997 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
36998 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
36999 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
37000 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37001 )),
37002 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
37003 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37004 )),
37005 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
37006 PROTOCOL_VERSION_DATA::ID => {
37007 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
37008 }
37009 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
37010 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
37011 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
37012 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
37013 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
37014 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
37015 RC_CHANNELS_OVERRIDE_DATA::random(rng),
37016 )),
37017 RC_CHANNELS_RAW_DATA::ID => {
37018 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
37019 }
37020 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
37021 RC_CHANNELS_SCALED_DATA::random(rng),
37022 )),
37023 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
37024 REQUEST_DATA_STREAM_DATA::random(rng),
37025 )),
37026 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
37027 RESOURCE_REQUEST_DATA::ID => {
37028 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
37029 }
37030 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
37031 RESPONSE_EVENT_ERROR_DATA::random(rng),
37032 )),
37033 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
37034 SAFETY_ALLOWED_AREA_DATA::random(rng),
37035 )),
37036 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
37037 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
37038 )),
37039 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
37040 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
37041 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
37042 SCALED_PRESSURE_DATA::ID => {
37043 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
37044 }
37045 SCALED_PRESSURE2_DATA::ID => {
37046 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
37047 }
37048 SCALED_PRESSURE3_DATA::ID => {
37049 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
37050 }
37051 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
37052 SERVO_OUTPUT_RAW_DATA::ID => {
37053 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
37054 }
37055 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
37056 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
37057 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
37058 )),
37059 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
37060 SET_ATTITUDE_TARGET_DATA::random(rng),
37061 )),
37062 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
37063 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
37064 )),
37065 SET_HOME_POSITION_DATA::ID => {
37066 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
37067 }
37068 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
37069 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
37070 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
37071 )),
37072 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
37073 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
37074 )),
37075 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
37076 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
37077 SMART_BATTERY_INFO_DATA::random(rng),
37078 )),
37079 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
37080 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
37081 STORAGE_INFORMATION_DATA::random(rng),
37082 )),
37083 SUPPORTED_TUNES_DATA::ID => {
37084 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
37085 }
37086 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
37087 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
37088 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
37089 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
37090 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
37091 TERRAIN_REQUEST_DATA::ID => {
37092 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
37093 }
37094 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
37095 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
37096 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
37097 )),
37098 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37099 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
37100 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
37101 ))
37102 }
37103 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37104 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
37105 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
37106 ))
37107 }
37108 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
37109 UAVCAN_NODE_INFO_DATA::ID => {
37110 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
37111 }
37112 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
37113 UAVCAN_NODE_STATUS_DATA::random(rng),
37114 )),
37115 UAVIONIX_ADSB_GET_DATA::ID => {
37116 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::random(rng)))
37117 }
37118 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
37119 UAVIONIX_ADSB_OUT_CFG_DATA::random(rng),
37120 )),
37121 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
37122 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::random(rng),
37123 )),
37124 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
37125 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
37126 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::random(rng),
37127 ))
37128 }
37129 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
37130 UAVIONIX_ADSB_OUT_CONTROL_DATA::random(rng),
37131 )),
37132 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
37133 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::random(rng),
37134 )),
37135 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
37136 UAVIONIX_ADSB_OUT_STATUS_DATA::random(rng),
37137 )),
37138 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
37139 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
37140 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::random(rng),
37141 ))
37142 }
37143 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
37144 UTM_GLOBAL_POSITION_DATA::random(rng),
37145 )),
37146 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
37147 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
37148 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
37149 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
37150 VICON_POSITION_ESTIMATE_DATA::random(rng),
37151 )),
37152 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
37153 VIDEO_STREAM_INFORMATION_DATA::random(rng),
37154 )),
37155 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
37156 VIDEO_STREAM_STATUS_DATA::random(rng),
37157 )),
37158 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
37159 VISION_POSITION_ESTIMATE_DATA::random(rng),
37160 )),
37161 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
37162 VISION_SPEED_ESTIMATE_DATA::random(rng),
37163 )),
37164 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
37165 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
37166 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
37167 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
37168 _ => None,
37169 }
37170 }
37171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
37172 match self {
37173 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37174 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
37175 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
37176 Self::AIS_VESSEL(body) => body.ser(version, bytes),
37177 Self::ALTITUDE(body) => body.ser(version, bytes),
37178 Self::ATTITUDE(body) => body.ser(version, bytes),
37179 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
37180 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
37181 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
37182 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
37183 Self::AUTH_KEY(body) => body.ser(version, bytes),
37184 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
37185 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
37186 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
37187 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
37188 Self::BATTERY_INFO(body) => body.ser(version, bytes),
37189 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
37190 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
37191 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
37192 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
37193 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
37194 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
37195 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
37196 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
37197 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
37198 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
37199 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
37200 Self::CANFD_FRAME(body) => body.ser(version, bytes),
37201 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
37202 Self::CAN_FRAME(body) => body.ser(version, bytes),
37203 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
37204 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
37205 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
37206 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
37207 Self::COLLISION(body) => body.ser(version, bytes),
37208 Self::COMMAND_ACK(body) => body.ser(version, bytes),
37209 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
37210 Self::COMMAND_INT(body) => body.ser(version, bytes),
37211 Self::COMMAND_LONG(body) => body.ser(version, bytes),
37212 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
37213 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
37214 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
37215 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
37216 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
37217 Self::CURRENT_MODE(body) => body.ser(version, bytes),
37218 Self::DATA_STREAM(body) => body.ser(version, bytes),
37219 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
37220 Self::DEBUG(body) => body.ser(version, bytes),
37221 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
37222 Self::DEBUG_VECT(body) => body.ser(version, bytes),
37223 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
37224 Self::EFI_STATUS(body) => body.ser(version, bytes),
37225 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
37226 Self::ESC_INFO(body) => body.ser(version, bytes),
37227 Self::ESC_STATUS(body) => body.ser(version, bytes),
37228 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
37229 Self::EVENT(body) => body.ser(version, bytes),
37230 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
37231 Self::FENCE_STATUS(body) => body.ser(version, bytes),
37232 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
37233 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
37234 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
37235 Self::FUEL_STATUS(body) => body.ser(version, bytes),
37236 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
37237 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
37238 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
37239 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
37240 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
37241 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
37242 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
37243 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
37244 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
37245 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
37246 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
37247 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37248 Self::GPS2_RAW(body) => body.ser(version, bytes),
37249 Self::GPS2_RTK(body) => body.ser(version, bytes),
37250 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37251 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
37252 Self::GPS_INPUT(body) => body.ser(version, bytes),
37253 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
37254 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
37255 Self::GPS_RTK(body) => body.ser(version, bytes),
37256 Self::GPS_STATUS(body) => body.ser(version, bytes),
37257 Self::HEARTBEAT(body) => body.ser(version, bytes),
37258 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
37259 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
37260 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
37261 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
37262 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
37263 Self::HIL_GPS(body) => body.ser(version, bytes),
37264 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
37265 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
37266 Self::HIL_SENSOR(body) => body.ser(version, bytes),
37267 Self::HIL_STATE(body) => body.ser(version, bytes),
37268 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
37269 Self::HOME_POSITION(body) => body.ser(version, bytes),
37270 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
37271 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
37272 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
37273 Self::LANDING_TARGET(body) => body.ser(version, bytes),
37274 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
37275 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
37276 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
37277 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
37278 Self::LOGGING_ACK(body) => body.ser(version, bytes),
37279 Self::LOGGING_DATA(body) => body.ser(version, bytes),
37280 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
37281 Self::LOG_DATA(body) => body.ser(version, bytes),
37282 Self::LOG_ENTRY(body) => body.ser(version, bytes),
37283 Self::LOG_ERASE(body) => body.ser(version, bytes),
37284 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
37285 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
37286 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
37287 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
37288 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
37289 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
37290 Self::MEMORY_VECT(body) => body.ser(version, bytes),
37291 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
37292 Self::MISSION_ACK(body) => body.ser(version, bytes),
37293 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
37294 Self::MISSION_COUNT(body) => body.ser(version, bytes),
37295 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
37296 Self::MISSION_ITEM(body) => body.ser(version, bytes),
37297 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
37298 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
37299 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
37300 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
37301 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
37302 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
37303 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
37304 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
37305 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
37306 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
37307 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
37308 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
37309 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
37310 Self::ODOMETRY(body) => body.ser(version, bytes),
37311 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
37312 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
37313 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
37314 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
37315 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
37316 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
37317 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
37318 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
37319 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
37320 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
37321 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
37322 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
37323 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
37324 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
37325 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
37326 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
37327 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
37328 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
37329 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
37330 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
37331 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
37332 Self::PARAM_SET(body) => body.ser(version, bytes),
37333 Self::PARAM_VALUE(body) => body.ser(version, bytes),
37334 Self::PING(body) => body.ser(version, bytes),
37335 Self::PLAY_TUNE(body) => body.ser(version, bytes),
37336 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
37337 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37338 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37339 Self::POWER_STATUS(body) => body.ser(version, bytes),
37340 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
37341 Self::RADIO_STATUS(body) => body.ser(version, bytes),
37342 Self::RAW_IMU(body) => body.ser(version, bytes),
37343 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
37344 Self::RAW_RPM(body) => body.ser(version, bytes),
37345 Self::RC_CHANNELS(body) => body.ser(version, bytes),
37346 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
37347 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
37348 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
37349 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
37350 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
37351 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
37352 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
37353 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
37354 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
37355 Self::SCALED_IMU(body) => body.ser(version, bytes),
37356 Self::SCALED_IMU2(body) => body.ser(version, bytes),
37357 Self::SCALED_IMU3(body) => body.ser(version, bytes),
37358 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
37359 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
37360 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
37361 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
37362 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
37363 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
37364 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37365 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
37366 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37367 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
37368 Self::SET_MODE(body) => body.ser(version, bytes),
37369 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37370 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37371 Self::SIM_STATE(body) => body.ser(version, bytes),
37372 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
37373 Self::STATUSTEXT(body) => body.ser(version, bytes),
37374 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
37375 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
37376 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
37377 Self::SYS_STATUS(body) => body.ser(version, bytes),
37378 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
37379 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
37380 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
37381 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
37382 Self::TIMESYNC(body) => body.ser(version, bytes),
37383 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
37384 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
37385 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
37386 Self::TUNNEL(body) => body.ser(version, bytes),
37387 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
37388 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
37389 Self::UAVIONIX_ADSB_GET(body) => body.ser(version, bytes),
37390 Self::UAVIONIX_ADSB_OUT_CFG(body) => body.ser(version, bytes),
37391 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(body) => body.ser(version, bytes),
37392 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(body) => body.ser(version, bytes),
37393 Self::UAVIONIX_ADSB_OUT_CONTROL(body) => body.ser(version, bytes),
37394 Self::UAVIONIX_ADSB_OUT_DYNAMIC(body) => body.ser(version, bytes),
37395 Self::UAVIONIX_ADSB_OUT_STATUS(body) => body.ser(version, bytes),
37396 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(body) => body.ser(version, bytes),
37397 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
37398 Self::V2_EXTENSION(body) => body.ser(version, bytes),
37399 Self::VFR_HUD(body) => body.ser(version, bytes),
37400 Self::VIBRATION(body) => body.ser(version, bytes),
37401 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37402 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
37403 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
37404 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37405 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
37406 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
37407 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
37408 Self::WINCH_STATUS(body) => body.ser(version, bytes),
37409 Self::WIND_COV(body) => body.ser(version, bytes),
37410 }
37411 }
37412 fn extra_crc(id: u32) -> u8 {
37413 match id {
37414 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
37415 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
37416 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
37417 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
37418 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
37419 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
37420 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
37421 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
37422 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
37423 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
37424 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
37425 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37426 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
37427 }
37428 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
37429 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
37430 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
37431 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
37432 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
37433 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
37434 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
37435 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
37436 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
37437 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
37438 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
37439 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
37440 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
37441 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
37442 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
37443 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
37444 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
37445 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
37446 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
37447 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
37448 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
37449 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
37450 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
37451 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
37452 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
37453 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
37454 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
37455 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
37456 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
37457 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
37458 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
37459 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
37460 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
37461 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
37462 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
37463 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
37464 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
37465 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
37466 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
37467 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
37468 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
37469 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
37470 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
37471 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
37472 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
37473 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
37474 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
37475 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
37476 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
37477 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
37478 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
37479 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
37480 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
37481 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
37482 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
37483 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
37484 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
37485 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37486 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
37487 }
37488 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
37489 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
37490 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
37491 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
37492 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37493 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
37494 }
37495 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
37496 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
37497 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
37498 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
37499 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
37500 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
37501 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
37502 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
37503 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
37504 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
37505 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
37506 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
37507 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
37508 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
37509 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
37510 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
37511 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
37512 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
37513 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
37514 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
37515 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
37516 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
37517 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
37518 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
37519 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
37520 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
37521 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
37522 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
37523 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
37524 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37525 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
37526 }
37527 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
37528 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
37529 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
37530 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
37531 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
37532 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
37533 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
37534 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
37535 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
37536 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
37537 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
37538 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
37539 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
37540 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
37541 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
37542 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
37543 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
37544 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
37545 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
37546 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
37547 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
37548 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
37549 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
37550 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
37551 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
37552 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
37553 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
37554 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
37555 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
37556 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
37557 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
37558 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
37559 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
37560 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
37561 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
37562 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
37563 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
37564 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
37565 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
37566 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
37567 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
37568 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
37569 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
37570 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
37571 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
37572 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
37573 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
37574 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
37575 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
37576 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
37577 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
37578 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
37579 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
37580 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
37581 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
37582 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
37583 PING_DATA::ID => PING_DATA::EXTRA_CRC,
37584 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
37585 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
37586 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
37587 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
37588 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
37589 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
37590 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
37591 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
37592 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
37593 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
37594 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
37595 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
37596 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
37597 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
37598 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
37599 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
37600 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
37601 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
37602 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
37603 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
37604 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
37605 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
37606 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
37607 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
37608 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
37609 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
37610 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
37611 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
37612 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
37613 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
37614 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
37615 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
37616 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
37617 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
37618 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
37619 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
37620 }
37621 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
37622 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
37623 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
37624 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
37625 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
37626 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
37627 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
37628 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
37629 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
37630 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
37631 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
37632 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
37633 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
37634 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
37635 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37636 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
37637 }
37638 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37639 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
37640 }
37641 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
37642 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
37643 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
37644 UAVIONIX_ADSB_GET_DATA::ID => UAVIONIX_ADSB_GET_DATA::EXTRA_CRC,
37645 UAVIONIX_ADSB_OUT_CFG_DATA::ID => UAVIONIX_ADSB_OUT_CFG_DATA::EXTRA_CRC,
37646 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
37647 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::EXTRA_CRC
37648 }
37649 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
37650 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::EXTRA_CRC
37651 }
37652 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => UAVIONIX_ADSB_OUT_CONTROL_DATA::EXTRA_CRC,
37653 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::EXTRA_CRC,
37654 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => UAVIONIX_ADSB_OUT_STATUS_DATA::EXTRA_CRC,
37655 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
37656 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::EXTRA_CRC
37657 }
37658 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
37659 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
37660 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
37661 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
37662 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
37663 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
37664 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
37665 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
37666 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
37667 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
37668 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
37669 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
37670 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
37671 _ => 0,
37672 }
37673 }
37674 fn target_system_id(&self) -> Option<u8> {
37675 match self {
37676 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
37677 Self::CANFD_FRAME(inner) => Some(inner.target_system),
37678 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
37679 Self::CAN_FRAME(inner) => Some(inner.target_system),
37680 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
37681 Self::COMMAND_ACK(inner) => Some(inner.target_system),
37682 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
37683 Self::COMMAND_INT(inner) => Some(inner.target_system),
37684 Self::COMMAND_LONG(inner) => Some(inner.target_system),
37685 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
37686 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
37687 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
37688 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
37689 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
37690 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
37691 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
37692 Self::LOGGING_ACK(inner) => Some(inner.target_system),
37693 Self::LOGGING_DATA(inner) => Some(inner.target_system),
37694 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
37695 Self::LOG_ERASE(inner) => Some(inner.target_system),
37696 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
37697 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
37698 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
37699 Self::MISSION_ACK(inner) => Some(inner.target_system),
37700 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
37701 Self::MISSION_COUNT(inner) => Some(inner.target_system),
37702 Self::MISSION_ITEM(inner) => Some(inner.target_system),
37703 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
37704 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
37705 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
37706 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
37707 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
37708 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
37709 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
37710 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
37711 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
37712 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
37713 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
37714 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
37715 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
37716 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
37717 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
37718 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
37719 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
37720 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
37721 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
37722 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
37723 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
37724 Self::PARAM_SET(inner) => Some(inner.target_system),
37725 Self::PING(inner) => Some(inner.target_system),
37726 Self::PLAY_TUNE(inner) => Some(inner.target_system),
37727 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
37728 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
37729 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
37730 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
37731 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
37732 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
37733 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
37734 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
37735 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
37736 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
37737 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
37738 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
37739 Self::SET_MODE(inner) => Some(inner.target_system),
37740 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
37741 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
37742 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
37743 Self::TIMESYNC(inner) => Some(inner.target_system),
37744 Self::TUNNEL(inner) => Some(inner.target_system),
37745 Self::V2_EXTENSION(inner) => Some(inner.target_system),
37746 _ => None,
37747 }
37748 }
37749 fn target_component_id(&self) -> Option<u8> {
37750 match self {
37751 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
37752 Self::CANFD_FRAME(inner) => Some(inner.target_component),
37753 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
37754 Self::CAN_FRAME(inner) => Some(inner.target_component),
37755 Self::COMMAND_ACK(inner) => Some(inner.target_component),
37756 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
37757 Self::COMMAND_INT(inner) => Some(inner.target_component),
37758 Self::COMMAND_LONG(inner) => Some(inner.target_component),
37759 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
37760 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
37761 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
37762 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
37763 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
37764 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
37765 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
37766 Self::LOGGING_ACK(inner) => Some(inner.target_component),
37767 Self::LOGGING_DATA(inner) => Some(inner.target_component),
37768 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
37769 Self::LOG_ERASE(inner) => Some(inner.target_component),
37770 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
37771 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
37772 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
37773 Self::MISSION_ACK(inner) => Some(inner.target_component),
37774 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
37775 Self::MISSION_COUNT(inner) => Some(inner.target_component),
37776 Self::MISSION_ITEM(inner) => Some(inner.target_component),
37777 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
37778 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
37779 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
37780 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
37781 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
37782 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
37783 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
37784 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
37785 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
37786 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
37787 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
37788 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
37789 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
37790 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
37791 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
37792 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
37793 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
37794 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
37795 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
37796 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
37797 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
37798 Self::PARAM_SET(inner) => Some(inner.target_component),
37799 Self::PING(inner) => Some(inner.target_component),
37800 Self::PLAY_TUNE(inner) => Some(inner.target_component),
37801 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
37802 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
37803 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
37804 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
37805 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
37806 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
37807 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
37808 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
37809 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
37810 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
37811 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
37812 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
37813 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
37814 Self::TIMESYNC(inner) => Some(inner.target_component),
37815 Self::TUNNEL(inner) => Some(inner.target_component),
37816 Self::V2_EXTENSION(inner) => Some(inner.target_component),
37817 _ => None,
37818 }
37819 }
37820}